如何在 VS Code 中创建更易于使用的箭头键快捷方式?

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

VS Code 中的箭头键的替代? 特别是右箭头键可以在双引号之外移动,而无需将手移向箭头键。

我只是想知道是否已经有可用的快捷键来代替手动按键映射。

visual-studio-code vscode-keybinding
2个回答
2
投票
您可能可以在 keybindings.json 中使用类似的内容(在

命令面板

中使用 
Preferences: Open Keyboard Shortcuts (JSON) 打开):

{ "key": "alt+w", "command": "cursorUp", "when": "textInputFocus", }, { "key": "alt+shift+w", "command": "cursorUpSelect", "when": "textInputFocus", }, { "key": "alt+a", "command": "cursorLeft", "when": "textInputFocus", }, { "key": "ctrl+alt+a", "command": "cursorWordLeft", "when": "textInputFocus", }, { "key": "alt+shift+a", "command": "cursorLeftSelect", "when": "textInputFocus", }, { "key": "ctrl+shift+alt+a", "command": "cursorWordLeftSelect", "when": "textInputFocus", }, { "key": "alt+s", "command": "cursorDown", "when": "textInputFocus", }, { "key": "alt+shift+s", "command": "cursorDownSelect", "when": "textInputFocus", }, { "key": "alt+d", "command": "cursorRight", "when": "textInputFocus", }, { "key": "ctrl+alt+d", "command": "cursorWordRight", "when": "textInputFocus", }, { "key": "alt+shift+d", "command": "cursorRightSelect", "when": "textInputFocus", }, { "key": "ctrl+shift+alt+d", "command": "cursorWordRightSelect", "when": "textInputFocus", },
但我只是使用 Windows 上的 AutoHotKey 和 Ubuntu 上的 xkbd 将我的键重新映射到更接近系统级别,这很好,因为它适用于几乎所有我的应用程序。


0
投票
我通过以下步骤实现了它 -

  1. Ctrl + p
    
    
  2. 输入
  3. > Preferences: Open Keyboard Shortcuts (JSON)
    并按回车键
  4. 应打开一个
  5. keybindings.json
     文件
  6. 将以下属性粘贴到
  7. 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.