How do I skip a match when using Ctrl+D for multiple selections in Sublime Text 2?

Viewed 49619

I have some code like:

testVar = { a: 1 };
testVariable1 = 2;
var c = testVar.a + testVariable2;
var d = testVar;

I want to rename "testVar" variable. When I set multiple cursors with Ctrl+D and edit variable, "testVariable" is also selected and edited.

Is there a way to skip some selections while setting multiple cursors with Ctrl+D?

6 Answers

Updated answer for vscode in 2020 on windows, in keybindings.json add this line to skip the next selected occurrence easily:

  {
    "key": "ctrl+alt+d",
    "command": "editor.action.moveSelectionToNextFindMatch",
    "when": "editorFocus"
  },

*yes I know the question is for sublime text, but I found it by googling the same question + vscode, so it might help someone since the mappings are identical.

I think I get why it was confusing to me: This is not skipping, it's unselecting.

You hit Ctrl+D as usual and if you select one by mistake you do Ctrl+K, D where you first press the K and then the D without letting go the Ctrl. This unselects the selection.

Related