driechel
driechel

Reputation: 3453

Sublime text 2 tab through multiple selection

Lets say that I have selected the word 'test' three times using ctr + d. Is there a way to tab through the selections. So for example if I wanted to go to the second word and only change that one.

I seem to need this quite often but I cannot find it anywhere. And I also know about the skipping with ctr + d and ctr + k but this is not what I mean.

Upvotes: 2

Views: 970

Answers (3)

r-stein
r-stein

Reputation: 4857

The MultiEditUtils package supports this.

Just install the package and bind a key to the selection_fields command, e.g.

{ "keys": ["alt+d"], "command": "selection_fields" },

To use it just create your multiple selection and press the keybinding. Then you can use tab and shift+tab to tab through the selection. If you tab behind the last one or press escape, then the multiple selection will be restored.

Demo:

enter image description here

Upvotes: 7

r-dent
r-dent

Reputation: 697

  1. Hit Control+F to bring up the search
  2. Type the term you want to replace
  3. Put your cursor at the beginning of your document
  4. Hit Control+G to select one instance after the other and change it

Upvotes: 0

dbn
dbn

Reputation: 13940

It sounds like what you want is search. Sublime's search is accessed via Control+F (Windows/Linux), or Command+F (Mac). Sublime's search behaves similarly to many other applications, often web browsers have this feature. You can use this to cycle through instances until you find the one you were looking for. If you then hit enter, search will exit and the cursor will stop at the currently selected instance of your word.

See Sublime's unofficial docs for more details about its full search capabilities.

Upvotes: 1

Related Questions