Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to navigate between instances of selected text in Sublime Text 3?

Sublime Text 3 highlights all instances of currently selected text. Is there any shortcut to navigate cursor to the next / previous instance (copy) of selected text?

So far, I've only managed to find out some information about adding more instances to current selection (expanding it) with Ctrl+D, skipping current instance (Ctrl+K, Ctrl+D) and deselecting it (Ctrl+U), which actually is a soft undo, not a real command.

I can use Ctrl+D to go to next instance of selected text and Ctrl+U to undo. But, since these shortcuts operates on selection, this is not, what I'm looking for.

Actually, I'm asking, is there any way to have this as simple as pressing Alt+Right to go to the next instance or Alt+Left to go to previous.

If this is not solved by default, then what commands should be tied to user-defined keyboard shortcuts?

like image 948
trejder Avatar asked Sep 18 '14 22:09

trejder


People also ask

How do I change all occurrences in Sublime Text?

In Sublime Text, you can edit all occurrences of a word by highlighting the words with alt+F3 , and then typing whatever you want to change the word to.

What is Ctrl D in sublime?

Ctrl + D in SublimeText is "Quick Add Next." This appears to be equivalent to Ctrl + B in Brackets, which is "Add next match to Selection" on the Find menu.

How do I use multiple cursors in Sublime Text 3?

While you can place multiple text cursors in Sublime Text with Cmd–Click (Mac) or Ctrl–Click (Windows), here's another technique that comes in handy. Hold Ctrl–Shift (Mac) or Ctrl–Alt (Windows) and hit Up or Down Arrow to place an additional text cursor above or below the current cursor.

How do I switch between columns in Sublime Text?

You can also use Ctrl + K , Ctrl + -> and Ctrl + K , Ctrl + <- . Glad to help.


1 Answers

Yes, all you need to do is edit your key bindings (Sublime Text -> Preferences -> Key Bindings User) for "find_under". Copy & paste this into your bindings and set your keys (defaults are "alt+super+g" and shift+alt+super+g)

{ "keys": ["alt+super+g"], "command": "find_under" },
{ "keys": ["shift+alt+super+g"], "command": "find_under_prev" },
like image 65
Arthur Avatar answered Oct 17 '22 10:10

Arthur