如何在 vscode 中从 Neovim 激活键绑定? [英] How to activate keybindings from neovim in vscode?

查看:12
本文介绍了如何在 vscode 中从 Neovim 激活键绑定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据他们的自述文件:https://github.com/asvetliakov/vscode-neovim#custom-键绑定,我将以下内容放在 ~/.config/Code/User/keybindings.json 中:

<预><代码>[{命令":vscode-neovim.compositeEscape2",键":k",何时":neovim.mode == 插入",参数":k"}]

然而,保存并重启vs后,按下jk仍然没有触发转义.为什么?

解决方案

首先确保你已经安装了 Neovim,然后在你的 keybindings.json 中添加以下内容:

<代码>{命令":vscode-neovim.compositeEscape1",键":j",何时":neovim.mode == 插入",args":j"},{命令":vscode-neovim.compositeEscape2",键":k",何时":neovim.mode == 插入",参数":k"}

According to their readme: https://github.com/asvetliakov/vscode-neovim#custom-keybindings, I have put the following in ~/.config/Code/User/keybindings.json:

[
    {
        "command": "vscode-neovim.compositeEscape2",
        "key": "k",
        "when": "neovim.mode == insert",
        "args": "k"
    }
]

However, after saving and restarting the vs, the escape is still not triggered when jk is pressed. Why is it?

解决方案

First make sure you have neovim installed then add the following to your keybindings.json:

{
    "command": "vscode-neovim.compositeEscape1",
    "key": "j",
    "when": "neovim.mode == insert",
    "args": "j"
},
{
    "command": "vscode-neovim.compositeEscape2",
    "key": "k",
    "when": "neovim.mode == insert",
    "args": "k"
}

这篇关于如何在 vscode 中从 Neovim 激活键绑定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆