如何在 Visual Studio Code 中为箭头键分配键盘快捷键

问题描述 投票:0回答:1

我正在使用 Visual Studio Code,在编码时,将手指移动到箭头键有时会让人感到恼火并破坏节奏。我正在寻找一种绑定键盘快捷键以移动光标的方法。

类似-

  • ctrl + j : 向左移动光标

  • ctrl + l :向右移动光标

  • ctrl + i:向上移动光标

  • ctrl + k : 向下移动光标

visual-studio-code shortcut
1个回答
0
投票

我按照以下步骤解决了我的问题 -

  1. Ctrl + p
  2. 输入
    > Preferences: Open Keyboard Shortcuts (JSON)
    并按回车键
  3. 应打开一个
    keybindings.json
    文件
  4. 将以下属性粘贴到
    keybindings
    文件的末尾,这应该可以解决问题。
    {
      "key": "ctrl+j",
      "command": "cursorLeft",
      "when": "editorTextFocus"
    },
    {
      "key": "ctrl+k",
      "command": "cursorDown",
      "when": "editorTextFocus"
    },
    {
      "key": "ctrl+l",
      "command": "cursorRight",
      "when": "editorTextFocus"
    },
    {
      "key": "ctrl+i",
      "command": "cursorUp",
      "when": "editorTextFocus"
    }
© www.soinside.com 2019 - 2024. All rights reserved.