小编Mic*_*pai的帖子

Visual Studio Code - 如何使用 [Alt]+[左/右] 逐字跳转

我已经开始在 MacOS 上使用 Visual Studio Code。

Alt+Left/Right跳转真的很烦人,因为它跳转到完整标识符而不是一个单词。

例子:

  • ?create_foo() Alt+ Rightcreate_foo?()
  • ?createFoo() Alt+ RightcreateFoo?()

我希望例如Ctrl+Right做上面的事情并修改Alt+的行为,Right以便它逐字跳转。

我想要的行为:

  • ?create_foo() Alt+ Rightcreate_?foo()
  • ?create_foo() Ctrl+ Rightcreate_foo?()

解决方案:

我的最终keybindings.json配置与添加Shift(选择)选项:

[
    {
        "key": "alt+left",
        "command": "cursorWordPartLeft",
        "when": "editorTextFocus",
    },
    {
        "key": "alt+right",
        "command": "cursorWordPartRight",
        "when": "editorTextFocus",
    },
    {
        "key": "shift+alt+left",
        "command": "cursorWordPartLeftSelect",
        "when": "editorTextFocus"
    },
    {
        "key": "shift+alt+right",
        "command": "cursorWordPartRightSelect",
        "when": "editorTextFocus" …
Run Code Online (Sandbox Code Playgroud)

editor visual-studio-code

12
推荐指数
1
解决办法
4852
查看次数

标签 统计

editor ×1

visual-studio-code ×1