gpt4 book ai didi

vim - VSCodeVim 键重映射

转载 作者:行者123 更新时间:2023-12-05 06:30:20 27 4
gpt4 key购买 nike

通过在 .vimrc 中添加以下内容,我可以在插入模式下跳转到 VIM 中的行尾:

inoremap <C-e> <C-o>$

   inoremap maps a key combination for insert mode
<C-e> is the keybinding I am creating.
<C-o> is a command that switches vim to normal mode for one command.
$ jumps to the end of the line and we are switched back to insert mode.

我如何在 VSCodeVim 插件中做到这一点?

到目前为止,这是我尝试过的:

"vim.insertModeKeyBindings": [
{
"before": ["j", "j"],
"after": ["<Esc>"]
},
{
"before": ["<C-e>"],
"after": ["<C-o>$"]
},
{
"before": ["<C-r>"],
"after": [],
"commands": [
{
"command": "redo"
}
]
},
],

最佳答案

将以下内容放入您的 keybindings.json

[
{
"key": "ctrl+s e",
"command": "workbench.action.splitEditor"
},
{
"key": "cmd+\\",
"command": "-workbench.action.splitEditor"
},
{
"key": "ctrl+s t",
"command": "workbench.action.terminal.split",
"when": "terminalFocus"
},
{
"key": "cmd+\\",
"command": "-workbench.action.terminal.split",
"when": "terminalFocus"
},
{
"key": "cmd+\\",
"command": "workbench.action.toggleSidebarVisibility"
},
{
"key": "cmd+b",
"command": "-workbench.action.toggleSidebarVisibility"
},
{
"key": "cmd+b cmd+",
"command": "gitlens.openChangedFiles"
},
{
"key": "cmd+b",
"command": "workbench.action.showAllEditors"
},
{
"key": "alt+cmd+tab",
"command": "-workbench.action.showAllEditors"
},
{
"key": "ctrl+alt+cmd+",
"command": "cursorColumnSelectDown",
"when": "textInputFocus"
},
{
"key": "shift+alt+cmd+down",
"command": "-cursorColumnSelectDown",
"when": "textInputFocus"
},
{
"key": "shift+alt+cmd+down",
"command": "cursorColumnSelectDown"
},
{
"key": "ctrl+a",
"command": "cursorHome",
"when": "textInputFocus"
},
{
"key": "ctrl+z",
"command": "cursorEnd",
"when": "textInputFocus"
},
// {
// "key": "ctrl+a",
// "command": "cursorLineStart",
// "when": "textInputFocus"
// },
// {
// "key": "ctrl+a",
// "command": "-cursorLineStart",
// "when": "textInputFocus"
// },
{
"key": "ctrl+cmd+t",
"command": "workbench.action.reopenClosedEditor"
},
{
"key": "shift+cmd+t",
"command": "-workbench.action.reopenClosedEditor"
}
]

关于vim - VSCodeVim 键重映射,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52523151/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com