Visual Studio Code: Select each occurrence of find

梦想的初衷 提交于 2020-04-07 11:02:30

问题


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.


回答1:


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.




回答2:


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.




回答3:


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 ....




回答4:


For Mach User:

COMMAND + Shift+ L Select all occurrences of the current selection

COMMAND + F2 Select all occurrences of the current word




回答5:


For mac users::

Control + Command + G

^ + + G




回答6:


If you are searching in a single file, use simple search using Ctrl+F, then even if you close the search box, simply keep pressing F3 to go to next match and so on. F3 just repeats previous search and selects your next match.




回答7:


Ctrl+F2 is what worked for me for VSCode on Windows 10.

While Ctrl+Shift+L just opened some Language selector.



来源:https://stackoverflow.com/questions/35992145/visual-studio-code-select-each-occurrence-of-find

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!