
看了 VSCodeVim 扩展的官方文档,并且去谷歌上搜索都没有找到答案.
总觉得这个功能很基本,应该是可以实现的,也许是我没找到,所以来这里问一问.
1 masquerader 2021 年 1 月 29 日 这个是挺基本的。你用的哪个扩展?如果是用的 vscodevim.vim ,给你个参考: ``` vscodevim.vim "vim.visualModeKeyBindings": [ { "before": [">"], "commands": ["editor.action.indentLines"] }, { "before": ["<"], "commands": [ "editor.action.outdentLines" ] } ] ``` 具体请参见 https://github.com/VSCodeVim/Vim |
2 AndyAO OP |
4 anonydmer 2021 年 1 月 29 日 缩进是需要 visual 模式下的 不过 vscode 的这个 vim 插件的缩进貌似不是在>之后即时缩进,需要随便再按个键,也没深究 |
5 anonydmer 2021 年 1 月 29 日 原来要重新按楼上的配置一下,我的问题就解决了。 |
6 masquerader 2021 年 1 月 29 日 插件还是很好用的,绑定键位的时候需要根据模式来绑定,例如 vim.normalModeKeyBindings": [ { "before":["<space>"], "commands": [ ":nohl" ] }, { "before": ["<leader>", "d"], "commands": [ "editor.action.peekDefinition" ] } ] 在命令模式下,空格的作用是清除高亮显示,[leader, d] 则是显示定义(不跳转)。 vscodevim.vim "vim.visualModeKeyBindings": [ { "before": [">"], "commands": ["editor.action.indentLines"] } ] 这段话是在选择模式下,输入大于号对选择的行进行缩进。 |