【问题标题】:Search with multiple cursors in VScode在 VScode 中使用多个光标进行搜索
【发布时间】:2021-10-20 12:47:52
【问题描述】:

注意:这不是与“Select all occurrences of selected word in VSCode

我已经有多个游标。想象| 是光标,我有 3 个这样的

Some Line|Some Text, More Text
Some Other Line|Some Other Text, Other More Text
Yet Another Line|Yet Some Other Text, Yet Other More Text

现在我想将所有 3 个光标移动到各自行中的 ,。理想情况下,我希望能够使用完整的搜索来执行此操作,因为搜索通常需要更多细微差别(例如第一个逗号后跟以 T 开头的单词)。这是我通常会在其他编辑器中使用键盘宏来解决的问题,但 VSCode 没有这些,我被告知多个光标是解决方案,但我还没有找到一种方法来搜索所有光标

【问题讨论】:

    标签: visual-studio-code


    【解决方案1】:

    您可以使用扩展名Select By 和命令moveby.regex

    您可以将其设置为使用固定的正则表达式来搜索或要求您提供正则表达式:

    {
        "key": "ctrl+shift+f6",  // or any other key combo
        "when": "editorTextFocus",
        "command": "moveby.regex",
        "args": {
          "ask": true,
          "properties": ["next", "start"]
        }
      }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-13
      • 2017-08-16
      相关资源
      最近更新 更多