我正在尝试在 Visual Studio Code 中使用 Vim 模式,使用他们的 VSCodeVim 扩展
在我的旧
vimrc
中,它看起来像:
map <S-space> <Esc>
在代码中
settings.json
我已经尝试过:
"vim.insertModeKeyBindingsNonRecursive": [
{
"before": ["<S-Space>"],
"after": ["<Esc>"]
}
],
不起作用:(
看起来像是他们的插件中的一个错误,而不是我做错的事情。
里面就是正常的
keybindings.json
:
{
"key": "shift+space",
"command": "extension.vim_escape",
"when": "editorTextFocus"
},
将此添加到
keybindings.json
:
{
"key": "shift+space",
"when": "editorTextFocus && vim.active && vim.mode == 'Insert' && !editorHasSelection",
"command": "extension.vim_escape",
}
vscodevim 现在好像不直接支持,
我使用空格和 shif+space 来滚动(就像在浏览器中一样),这也可以通过使用 vscode 的 api 来实现:
{
"key": "shift+space",
"command": "cursorMove",
"args": { "to": "up", "by": "line", "value": 5 }
}
settings.json 中的其他