Visual Studio Code: Select each occurrence of find

Ctrl+Shift+L Select all occurrences of current selection

editor.action.selectHighlights

Ctrl+F2 Select all occurrences of current word

editor.action.changeAll

Please refer for more information here.


well , basically the Ctrl+Shift+L will select all occurrences of word in the document
BUT there is some coool way to selecting them growingly:
if you hit Ctrl+d it will selects the second match , it you hit Ctrl+d again it will match the third one and so on ....


Alt+Enter Select all occurrences of find match

editor.action.selectAllMatches

This has the added benefit of working with Regular Expression searches, since selecting occurrences of a word of a selection cannot leverage the Regex functionality.


I know this thread is here for a while now, but I think this will be helpful:

This thread on Github talks exactly about it:

https://github.com/microsoft/vscode/pull/5715

Summary:

  • Ctrl+F --> Open find widegt.

  • Alt+R --> Turn on regex mode.

  • Input search text --> Regex text or normal text.

  • Alt+Enter --> Select all matches.

  • Left arrow --> Ajust cursors.(Ignore this step if you don't want to edit the ---selected text.)

  • Edit text --> Do what you want.(Ignore this step if you don't want to edit the -selected text.)

  • Shift+Home --> Select modified text.(Ignore this step if you don't want to edit the selected text.)

  • Ctrl+C --> Copy selected text.

  • Ctrl+N --> Open a new tab.

  • Ctrl+V --> Paste.