visual-studio-code - vscode + vim:注释行不会向下移动光标
问题描述
ctrl + /
在使用快捷方式注释当前行后,如何使 Visual Studio Code 将光标向下移动一行?我试过(在用户设置中):
"vim.normalModeKeyBindings": [
{
"before": ["<C+/>"],
"after": ["<C+/>", "j"]
}
]
但它不起作用。
使用 Linux Manjaro + vscode 1.27.2
解决方案
当前 vscode (1.48.0) 的解决方案:
- 安装这个扩展:
geddski.macros
- 将此行添加到
settings.json
:
"macros": { "commentLine": ["editor.action.commentLine","cursorDown"] },
- 将这些行添加到
keybindings.json
:
{
"key": "ctrl+/",
"command": "macros.commentLine",
"when": "editorTextFocus && !editorReadonly"
},
如何快速打开这些文件:
- 用于
keybindings.json
新闻Ctrl+Shift+p和写作Preferences: Open Keyboard Shortcuts (JSON)
- 按上面的
settings.json
快捷方式并写Preferences: Open Settings (JSON)
文件的物理位置:
Linux:
~/.config/Code/User/keybindings.json
~/.config/Code/User/settings.json
视窗:
%UserProfile%\AppData\Roaming\Code\User\keybindings.json
%UserProfile%\AppData\Roaming\Code\User\settings.json
苹果系统:
~/Library/Application\ Support/Code/User/keybindings.json
~/Library/Application\ Support/Code/User/settings.json
推荐阅读
- django - Django中的条件unique_together
- javascript - 处理多租户 React 应用程序
- python - 如何根据熊猫中另一个df中的整列选择所有列?
- java - 如何将适配器附加到 RecyclerView
- javascript - 将标题字段与数组进行比较时避免错误
- netlogo - NetLogo:让乌龟记住它的起始位置
- web-scraping - 如何不重试 Scrapy 请求?
- python - Python语音识别器将系统扬声器语音作为输入而不是麦克风怎么办?
- r - 使用 rselenium 和 rvest 通过 while 循环从多个表中跨多个页面提取数据
- php - Ajax 调用返回当前页面整页 HTML 而不是预期的数据