RJo*_*nes 4 visual-studio-code
使用VSCodeVim仿真运行 VS Code 。在配置中启用换行和相对编号:
"editor.wordWrap": "on",
"editor.lineNumbers":"relative"
Run Code Online (Sandbox Code Playgroud)
换行时,显示行不会在编辑器中编号。是否可以配置 VS Code 以允许直接导航到显示行?
And*_*ins 11
VSCodeVim 可以像 Vim 一样通过显示行进行导航,使用gk和gj。您可以重新映射j并k像这样:
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["j"],
"after": ["g", "j"]
},
{
"before": ["k"],
"after": ["g", "k"]
}
]
Run Code Online (Sandbox Code Playgroud)
如果您启用自动换行并希望光标在使用j, k,?或时输入每个换行的行,请?在 VS Code 的 keybindings.json 设置文件中设置以下内容(如Andrew 的回答,其他选项存在但速度较慢):
{
"key": "up",
"command": "cursorUp",
"when": "editorTextFocus && vim.active && !inDebugRepl && !suggestWidgetMultipleSuggestions && !suggestWidgetVisible"
},
{
"key": "down",
"command": "cursorDown",
"when": "editorTextFocus && vim.active && !inDebugRepl && !suggestWidgetMultipleSuggestions && !suggestWidgetVisible"
},
{
"key": "k",
"command": "cursorUp",
"when": "editorTextFocus && vim.active && !inDebugRepl && vim.mode == 'Normal' && !suggestWidgetMultipleSuggestions && !suggestWidgetVisible"
},
{
"key": "j",
"command": "cursorDown",
"when": "editorTextFocus && vim.active && !inDebugRepl && vim.mode == 'Normal' && !suggestWidgetMultipleSuggestions && !suggestWidgetVisible"
}
Run Code Online (Sandbox Code Playgroud)
参考:VSCodeVim 自述文件(在我的文档 PR 之后)
| 归档时间: |
|
| 查看次数: |
2295 次 |
| 最近记录: |