Visual Studio Code Vim:如何绑定shift-space

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

我正在尝试在 Visual Studio Code 中使用 Vim 模式,使用他们的 VSCodeVim 扩展

在我的旧

vimrc
中,它看起来像:

map <S-space> <Esc>

在代码中

settings.json
我已经尝试过:

"vim.insertModeKeyBindingsNonRecursive": [
    {
        "before": ["<S-Space>"],
        "after": ["<Esc>"]
    }
],

不起作用:(

visual-studio-code vscodevim
2个回答
3
投票

看起来像是他们的插件中的一个错误,而不是我做错的事情。

这里有一个解决方法

里面就是正常的

keybindings.json
:

{
    "key": "shift+space",
    "command": "extension.vim_escape",
    "when": "editorTextFocus"
 },

0
投票

将此添加到

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 中的其他

© www.soinside.com 2019 - 2024. All rights reserved.