Vim中的撤销undo与反撤销redo
如下图所示,修改vim模式下的ctrl-r
为U
,但是这样做会出现问题,在插入模式下将无法输入字母U
解决方法
(1)打开keybindings.json
,完整地址:~/Library/Application Support/Code/User/keybindings.json
(2)添加下面的代码即可
{
"key": "shift+u", // redo in vim
"command": "extension.vim_ctrl+r",
"when": "textInputFocus && vim.mode != 'Insert'"
},
注:可以通过Copy复制默认的快捷键配置代码
参考资料
- Undo in vim extension can’t be redo-ed by the redo command of vscode
- https://code.visualstudio.com/docs/getstarted/keybindings