Search code examples
visual-studio-codekeyboard-shortcuts

VScode shortcut to select up to next space?


You can select entire words with the shortcut Ctrl + Shift + [Right/Left arrow] but is there a shortcut to select everything up to next space? Say I want to select the text foo/bar the previous shortcut will stop at the / slash symbol, but I want to select up to the end of the expression, which in this case, will end at the next space.

I tried the vscode-powertools solution from this post but couldn't make it work.

Edit: I'm working on Windows 10


Solution

  • you can use the extension I wrote: Select By

    Add this keybinding:

      {
        "key": "ctrl+shift+alt+right",
        "when": "editorTextFocus",
        "command": "selectby.regex",
        "args": {
          "forward": " ",
          "forwardInclude": false
        }
      }