Visual Studio Code: Select each occurrence of find

我正在寻找一个“选择每个发生”的东西,我试图找到。例如,一个文件有一堆包含“ abc”的文本,我键入 ctrl + f,然后键入 abc。我可以找到第一个或下一个,但我想“多光标”在文件中的每一个。

我已经找到了一个特性,它可以让我突出显示文本和 ctrl + d,以获得下一个匹配所选内容的内容,但是如果有上百个这样的内容,那就太烦人了。

110172 次浏览

Ctrl + Shift + L 选择当前选择的所有出现

editor.action.selectHighlights

Ctrl + F2 选择当前单词的所有匹配项

editor.action.changeAll

详情请参阅 给你

Alt+Enter Select all occurrences of find match

editor.action.selectAllMatches

这样做还有使用正则表达式搜索的额外好处,因为选择所选内容中某个单词的匹配项不能利用 Regex 功能。

For mac users::

Control + Command + G

^ + + G

If you are searching in a single file, use simple search using ABC0 + 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.

well , basically the Ctrl+Shift+L will select all occurrences of word in the document
BUT 有一些很酷的方法可以越来越多地选择它们:
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 ....

For Mach User:

选择当前选择的所有匹配项

COMMAND + F2 Select all occurrences of the current word

Ctrl + F2是我在 Windows10的 VSCode 中使用的。

Ctrl + Shift + L刚刚打开了一些语言选择器。

我知道这个帖子已经有一段时间了,但我认为这个会有帮助:

Github 上的这个帖子就是这么说的:

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

Summary:

  • Ctrl + F —— > Open find widget。

  • Alt + R —— > 打开正则表达式模式。

  • 输入搜索文本—— > 正则表达式文本或普通文本。

  • Alt+Enter --> Select all matches.

  • 左箭头-> 调整游标。(如果不想编辑——-选中的文本,请忽略此步骤。)

  • 编辑文本—— > 做你想做的。(如果你不想编辑选中的文本,忽略这个步骤。)

  • Shift + Home —— > 选择修改过的文本。(如果不想编辑选中的文本,请忽略此步骤。)

  • Ctrl + C —— > 复制选定的文本。

  • Ctrl + N —— > 打开一个新标签页。

  • Ctrl + V —— > 粘贴。