Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I skip / jump past next string instance selection in VSCode?

Whilst running the hotkey for multiple cursors CMD + D I keep finding myself in need of skipping only one item.

So for instance, in the following code, pipes indicate my current selection and the item in the middle I would like to skip.

 checked=""| 
 checked=""| 
 checked=""| 
 checked=""| // <-- I am here in my selection
 checked=""  // <-- skip this item for selection and proceed to select the rest
 checked=""
 checked=""
 checked=""

Is this doable in VSCode?

What have I tried so far?

I have tried using shift and looking up the VSCode shortcuts documentation.

like image 596
Anon Avatar asked Nov 24 '19 01:11

Anon


People also ask

How do you skip the next selection in VS Code?

You can press Ctrl + K and Ctrl + D at the same time to skip a selection.

How do you jump in VS Code?

VS Code provides two powerful commands to navigate in and across files with easy-to-use key bindings. Hold Ctrl and press Tab to view a list of all files open in an editor group. To open one of these files, use Tab again to pick the file you want to navigate to, then release Ctrl to open it.

How do you skip to the end of a line in VS Code?

Highlight the row and press ENTER. Press Shift + Space.

How do you tab a selection in VS Code?

F1 → open Keyboard Shortcuts → search for 'Indent Line', and change keybinding to Tab . It will allow you to indent line when something in that line is selected (multiple lines still work).


1 Answers

There are two ways:

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

This keybinding is already there. You actually select the one you want to skip and then do Ctrl+K Ctrl+D to move that last selection you did to the next find match.

Or, just select them all with Ctrl+Shift+Land then go back with your multicursor modifier key Cmd/Alt and deselect the ones you don't want one by one.

Here is a demo of both methods - the gif doesn't show all the keystrokes very well unfortunately - the skip one is Ctrl+K Ctrl+D as explained above after you have selected one too many:

demo of skipping find matches

like image 131
Mark Avatar answered Oct 13 '22 00:10

Mark