Xcode 3.2 find and replace in selected text - cocoa

Is it possible to find and replace in selected text in Snow Leopard Xcode 3.2? There always use to be an option for selected text. Really frustrating. Thanks.

Yeah, but it's a lot less obvious now. If you have the "Find" bar up, change the first dropdown menu to "Find & Replace". Then, if you hold option, the "Replace All" button turns into an "In Selection" button.

You can press Command+Ctrl+F to bring up directly the Find & Replace bar, and press Escape to remove it. I don't think there's anyway to activate the "Replace All" button using the keyboard, but then again there never was afaik.

In XCode 5 and earlier you can highlight a word and hit CMD+CTRL+E and then simply edit the word in line and it applies your edit to all occurrences of that word in the document.

Sometimes an image helps make things a little easier to grasp quickly. So this is to supplement the chosen answer.
And holding down Option:

Related

How to prevent auto-complete popup display after comma or colon?

I just updated my Sublime Text version (Build 4107), and it seems to me a new behaviour appeared - that I would like to avoid.
Whenever I write a colon or comma, the auto-complete popup automatically displays, which is problematic because most of the time in this situation I am about to go to next line by pressing Enter. Thing is, if press Enter, I select now the first occurence of autocomplete instead of going to next line.
I can avoid this by doing "Alt + Enter" or by pressing "Esc" before Enter, but it is not a convenient solution. Is there any way to prevent this autocomplete popup to display afer this particular punctuation signs ?
I read about punctuation.separator scope naming (https://www.sublimetext.com/docs/scope_naming.html#punctuation). But I can't figure out how to use it in auto_complete_foo settings to do what I want.
Example :
Thanks for the help !
If you have a package SublimeCodeIntel, try to disable it, and check the problem is saved or not
It helped me
You can set "auto_complete_when_likely": false, in your user preferences which should prevent this behavior.

How do I turn off "column box select" in visual studio code?

I seem to be unable to turn off box/column select. In other words, if I try to select across multiple lines, I only get a box select, as opposed to the usual behavior where entire lines are selected as I add lines.
I am using version 1.48.2 on a mac.
I must have pressed option+shift or some other such code inadvertently and now I can only select boxes. I have looked at my keyboard shortcuts but I don't know what to look for...
Unfortunately searching for solutions via google or SE only produces results for how to turn it on, not off! I don't know what the opposite mode is. "line select" seems to be just to select the current line, not for entire lines across multiline selections.
example of current behavior. I want the entire line "spaceship..." to be selected.
Just found the answer myself looking for something else. There is a "Text Editor" setting called "Editor: Column Selection" that controls this. The default is off, but I must have turned it on somehow without realizing it. Thanks to anyone who may have taken time to read this....
Cmd+8 is the shortcut to toggle the setting

Xcode- Make Textview continue horizontally forever

I am trying to make a basic text editor (For a School Project if you are wondering) and I want to make it work with different code. The problem is that I cant get TextView to go on forever horizontally. Similar to Notepad++. I have set it to have the ability scroll horizontally, but I cannot seem to make the text keep going on one line. This is for a Mac OS X application and I am using Xcode 5. Also, on a side note, if you by chance know how to number the rows, I would greatly appreciate that as well. Thank you!
Menu option: Xcode->Preferences
From there go to the "Text Editing" tab and check the box for "Line numbers" then in the Indentation subtab uncheck the box for "line wrapping"
To disable word wrap on an NSTextView see this SO answer

XCode 4 beeps when entering brackets

How can I turn this behavoir off?
It happens when you enter a close bracket without a matching open bracket. Which is annoying because I do that all the time. I don't need xcode beeping at me (under any circustances).
(Of course I always go back and put the opening bracket in, I guess this makes me wierd, but my mind just works that way, and I don't need xcode nagging me about it.)
Goto Xode-> Preferences-> Text Editing-> Code completion
in this u can then untick option "balance brackets in objective-c method calls"
It shold help you. But I suggest you to keep this option enable.
Also in "General" tab of Xcode preference you can set "Play Sound"(first option) enable/disable.

How can I find and replace inside a selection in Xcode?

In Xcode < 4, you could hold the "option" key, and the "Replace All" button would change to "Replace in Selection". As of Xcode 4, this does nothing. Anyone know if there's a new way to do it, or is it bug filing time?
This appears to be working again now, at least in Xcode 4.4.1.
When the find/replace bar appears at the top of the editor, holding down the option key on the keyboard causes "Replace in Selection" to appear in lieu of "Replace All."
I'm glad, because this was an ANNOYING omission.
Another workaround:
In Xcode, select the text, press copy
In a terminal session:
pbpaste|sed 's/SOURCETEXT/NEWTEXT/g'|pbcopy
Return to Xcode window, press paste
Since the original should still be selected, it will just be replaced. You could probably build a simple shell script to do this.
Doug
An few images to supplement the chosen answer:
And holding down Option:
See also
Find/Replace in Xcode using Regular Expressions
Seems like missing functionality. You should file a bug report.
I'm upset that they took out this functionality, as I used it constantly, but here's my workaround. Copy your selected text from Xcode4 to TextEdit or some other word processor, do the find and replace there, and then copy the results back into Xcode.
It's not sexy but it's worth it if you do a lot of these "find and replace on my selection", and you leave the word processor open in Spaces as you work.
They should add "my selection" as an alternative to "workspace" and "my scope".
There is another way only replace the matches you find, rather than just this one or all of them.
I suggest you save a copy first, just in case....
In Find and Replace, Show Find Options (you can do this by pressing the magnifying glass).
Press Preview.
Uncheck all the ones you don't want replacing.
Press Replace
Hope that helps, it did me.
Not ideal, but not too bad:
Do a find and replace in workspace (cmd-opt-shift-f) enter your desired find/replace
Enter your desired search term and hit return
Select the range of replacements from the list of matches on the left
Hit replace (not replace all)
To replace text in a selection using Xcode 9
Press Option-Command-F to bring up the find/replace box.
Enter the search and replace string. Changing the search string will lose any existing selection, so..
Make your selection (again). (If you don't do this, the selection will be the first search string found only)
Hold down the key and "Replace All" will change to "Replace Selection", then click it.
Once you understand that you make your selection AFTER you have entered the search string, then this is not that clumbersome and works fine.
I find alt-command-f easier for local find and replace (4.3) and then working around your selection.
EthenA.Wilson asked in a comment to the OP a couple of days ago:
"Is there a way to do this in Xcode 5?"
For the benefit of those who, like me, had been searching for it, here's how:
After you put your Find and Replace terms in the bars at the top left-hand side of the editor page, select the text you want to search in, then look at the top right-hand side (same bar). You'll see where it says "All", right next to "Replace." Now press the Option key. "All" will change to "All in Selection." Click it, and you're done. Could be a bit more intuitive, but the functionality is there in Xcode 5.
Naturally, good idea to take a snapshot before you click!
HTH!
Not sure which feature prior to Xcode 4 you're referring to, but the shortcut Command+Shift+E gives you "Use Selection for Replace". If you're talking about "Find and Replace in Workspace" (Command+Option+Shift+F), then what you need to do is run your find and then hold down "Shift" or "Command" on the selections shown and then hit "Replace".

Resources