Visual Studio Code: Select each occurrence of find

djb picture djb · Mar 14, 2016 · Viewed 69.8k times · Source

I'm looking for a "select each occurrence of" something I'm trying to find. For example a file has a bunch of text that includes "abc", I type ctrl+f and type abc. I can either find the first one or the next one, but I would like to "multi-cursor" each one in the file.

I've already found the feature that lets me highlight text and ctrl+d to get the next that matches the selection, but if there's a hundred of these things - well that gets quite tiresome.

Answer

Dauren Akilbekov picture Dauren Akilbekov · Mar 15, 2016

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.