简体   繁体   English

select 使用多个光标时单词的下一次出现

[英]select next occurence of a word when using multiple cursors

From the bellow screen shot you can see that I have placed multi-cursor one multiple lines.从下面的屏幕截图中,您可以看到我已经将多光标放置在多行中。

在此处输入图像描述

I want the next occurrence of " to be selected on each line for each cursor. I know I can use ctrl d for selecting next occurrence. But it only works for single cursor. What is the solution for multi-cursor?我希望在每一行上为每个 cursor 选择下一次出现的" 。我知道我可以使用ctrl d选择下一次出现。但它只适用于单个 cursor。多光标的解决方案是什么?

with the extension Select By v0.11.0 and the command moveby.regex you can move multiple cursors based on a regular expression.使用扩展名Select 通过v0.11.0 和命令moveby.regex您可以根据正则表达式移动多个光标。

The regular expression can be fixed in the keybinding or asked from the user.正则表达式可以固定在键绑定中或向用户询问。

For fixed regex use a key binding like:对于固定的正则表达式,使用如下键绑定:

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

To ask for a regex use a key binding like:要请求正则表达式,请使用如下键绑定:

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

In the Inputbox enter the regular expression in a non-escaped form.在输入框中以非转义形式输入正则表达式。 In a JSON files you need to escape the " and \ characters.在 JSON 文件中,您需要转义"\字符。

In a later version the command selectby.regex will also support multi cursor.在以后的版本中,命令selectby.regex也将支持 multi cursor。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM