vscode vim 自定义一些快捷键
本帖最后由 古月不傲 于 2020-12-1 17:18 编辑{
"vim.easymotion": true,
"vim.sneak": true,
"vim.useSystemClipboard": true,
// 设置自定义控制键 空格
"vim.leader": "<space>",
// 以下按键依旧有效
"vim.handleKeys": {
"<C-c>": false,
"<C-v>": false,
"<C-z>": false,
"<C-s>": false,
"<C-a>": false,
},
// 普通模式递归映射
"vim.normalModeKeyBindings":
[
// 强制退出当前文件
{"before": ["<leader>","q",],"commands": [":q!",]},
// 强制保存当前文件
{"before": ["<leader>","w",],"commands": [":w!",]},
// 强制保存并退出当前文件
{"before": ["<leader>","r",],"commands": [":wq!",]},
// 强制退出所有文件
{"before": ["<leader>","a",],"commands": [":qa!",]},
// 水平分屏
{ "before": ["\\",],"commands": [":vsp",]},
// 垂直分屏
{ "before": ["|",],"commands": [":sp",]},
// 窗口切换
{"before": ["<C-h>",],"after": ["<C-w>","h",]},
{"before": ["<C-l>",],"after": ["<C-w>","l",]},
{"before": ["<C-j>",],"after": ["<C-w>","j",]},
{"before": ["<C-k>",],"after": ["<C-w>","k",]},
// 切换下一个文件
{"before": ["F",],"commands": [":tabn",]},
// 切换上一个文件
{"before": ["B",],"commands": [":tabp",]},
// 新建文件
{"before": ["N",],"commands": [":tabnew",]},
// 关闭其他文件
{"before": ["<leader>", "x",],"commands": [":tabo",]},
],
// 插入模式非递归映射
"vim.insertModeKeyBindingsNonRecursive":
[
// 切换普通模式
{"before": ["i","i",],"after": ["<Esc>",]},
],
// 普通模式非递归映射
"vim.normalModeKeyBindingsNonRecursive":
[
// 跳至行首
{"before": ["H",],"after": ["^",],},
// 跳至行尾
{"before": ["L",],"after": ["$",]},
// 向下跳3行
{"before": ["J",],"after": ["3","j",],},
// 向上跳3行
{"before": ["K",],"after": ["3","k",],},
// 复制3行
{"before": ["Y",],"after": ["3","y",],},
// 删除3行
{"before": ["D",],"after": ["3","d","d",],},
// 删除至行首
{"before": ["d","a",],"after": ["d","^",]},
// 删除至行尾
{"before": ["d","g",],"after": ["d","$",]},
// 删除至行首并插入
{"before": ["<leader>","h",],"after": ["c","^",]},
// 删除至行尾并插入
{"before": ["<leader>","l",],"after": ["c","$",]},
// 空行不插入
{"before": [";",],"after": ["o","<Esc>",],},
],
} 学习了 谢谢 学习了,Vim还是特别好用的 感谢大佬分享 vim永远滴神{:301_986:} 学习了,感谢分享。 映射修改这些基础文件编辑指令一点意义没有,楼主把vim玩偏了
页:
[1]