How to select all instances of selected region in Sublime Text

Sublimetext

Sublimetext Problem Overview


Is there a shortcut key or single-step menu option to find and select all instances of a highlighted selection in Sublime Text?

Sublimetext Solutions


Solution 1 - Sublimetext

On Mac OS you can use: CMD + CTRL + G

Solution 2 - Sublimetext

On Windows/Linux press Alt+F3.

Solution 3 - Sublimetext

> 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.

Solution 4 - Sublimetext

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.

Solution 5 - Sublimetext

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" },

Solution 6 - Sublimetext

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.

Sublime Text 3

Solution 7 - Sublimetext

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 "https://stackoverflow.com/questions/16844657/sublime-text-select-all-instances-of-a-variable-and-edit-variable-name" and the answer in "https://stackoverflow.com/questions/16844657/sublime-text-select-all-instances-of-a-variable-and-edit-variable-name/18422707#18422707";, we have to start with a empty selection. That is, start using the shortcut Alt+F3 which would help selecting only the whole words.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMartin DevardaView Question on Stackoverflow
Solution 1 - SublimetextKurt UXDView Answer on Stackoverflow
Solution 2 - SublimetextoliView Answer on Stackoverflow
Solution 3 - Sublimetextuser847074View Answer on Stackoverflow
Solution 4 - SublimetextandrewswankView Answer on Stackoverflow
Solution 5 - Sublimetextd_coderView Answer on Stackoverflow
Solution 6 - SublimetextmindOf_LView Answer on Stackoverflow
Solution 7 - SublimetextRamValliView Answer on Stackoverflow