gpt4 book ai didi

visual-studio-code - vscode + vim : commenting line doesn't move cursor down

转载 作者:行者123 更新时间:2023-12-02 03:28:52 25 4
gpt4 key购买 nike

在使用 ctrl +/ 快捷键注释当前行后,如何使 Visual Studio Code 将光标向下移动一行?我尝试过(在用户设置中):

"vim.normalModeKeyBindings": [
{
"before": ["<C+/>"],
"after": ["<C+/>", "j"]
}
]

但它不起作用。

使用 Linux Manjaro + vscode 1.27.2

最佳答案

当前vscode(1.48.0)的解决方案:

  1. 安装此扩展:geddski.macros
  2. 将此行添加到 settings.json:
"macros": { "commentLine": ["editor.action.commentLine","cursorDown"] },
  • 将这些行添加到 keybindings.json:
  • {
    "key": "ctrl+/",
    "command": "macros.commentLine",
    "when": "editorTextFocus && !editorReadonly"
    },

    如何快速打开这些文件:

    • 对于 keybindings.json,按 Ctrl+Shift+p 并写入 首选项:打开键盘快捷键 (JSON)
    • 对于 settings.json 按上面的快捷方式并写入 Preferences: Open Settings (JSON)

    文件的物理位置:
    Linux:

    • ~/.config/Code/User/keybindings.json
    • ~/.config/Code/User/settings.json

    Windows:

    • %UserProfile%\AppData\Roaming\Code\User\keybindings.json
    • %UserProfile%\AppData\Roaming\Code\User\settings.json

    Mac操作系统:

    • ~/Library/Application\Support/Code/User/keybindings.json
    • ~/Library/Application\Support/Code/User/settings.json

    关于visual-studio-code - vscode + vim : commenting line doesn't move cursor down,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52406245/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com