Is there a shortcut key or single-step menu option to find and select all instances of a highlighted selection in Sublime Text?
On Mac OS you can use: CMD + CTRL + G
On Windows/Linux press Alt+F3.
TextField
. You can't name all of them textfield
of course. So I admit that in some cases it's not specific enough (like TextFields) but if you are talking about controllers, I think it makes perfect sense eg articleController = new ArticleController()
On Windows/Linux press Alt+F3.
This worked for me on Ubuntu. I changed it in my "Key-Bindings:User" to something that I liked better though.
{ "keys": ["ctrl+shift+g"], "command": "find_all_under" }
On Mac:
⌘+CTRL+g
However, you can reset any key any way you'd like using "Customize your Sublime Text 2 configuration for awesome coding." for Mac.
On Windows/Linux:
Alt+F3
If anyone has how-tos or articles on this, I'd be more than happy to update.
Note: You should not edit the default settings, because they get reset on updates/upgrades. For customization, you should override any setting by using the user bindings.
On Mac:
Sublime Text 2 > Preferences > Key Bindings-Default
Sublime Text 3 > Preferences > Key Bindings
This opens a document that you can edit the keybindings for Sublime.
If you search "ctrl+super+g"
you find this:
{ "keys": ["ctrl+super+g"], "command": "find_all_under" },
default
config files, as they are replaced on update & upgrades. Use user
key binding files instead @dcryan22
user
keybindings. I just posted the default
binding to show what the key combination was.
In the other posts, you have the shortcut keys, but if you want the menu option in every system, just go to Find > Quick Find All, as shown in the image attached.
Also, check the other answers for key binding to do it faster than menu clicking.
https://i.stack.imgur.com/Anuem.png
Even though there are multiple answers, there is an issue using this approach. It selects all the text that matches, not only the whole words like variables.
As per "Sublime Text: Select all instances of a variable and edit variable name" and the answer in "Sublime Text: Select all instances of a variable and edit variable name", we have to start with a empty selection. That is, start using the shortcut Alt+F3 which would help selecting only the whole words.
Alt+F3
without selection -> whole word. With selection -> precise match.
Success story sharing
g
could stand for?g
et all of them? :)g
otta select'em all?