简体   繁体   English

除了F1,F2,F3(Ctrl + Fs等)以外,哪些是在Vim上创建自定义命令的好(可用)键?

[英]Besides F1, F2, F3, (Ctrl + Fs and so on), which are good (available) keys to create custom commands on Vim?

Besides F1 , F2 , F3 , ( Ctrl + Fs and so on), which are good (available) keys to create custom commands on Vim? 除了F1F2F3Ctrl + Fs等)以外,哪些是在Vim上创建自定义命令的好(可用)键?

Some plugins use , and \\ . 一些插件使用\\。 For instance, \\be and ,cc . 例如, \\be,cc Which are other good available keys to create custom commands on Vim? 在Vim上创建自定义命令还有哪些其他可用的键?

I'm a fan of using <Leader> in all my custom maps. 我喜欢在所有自定义地图中使用<Leader> That way I can easily avoid stomping on default mappings, and I can quickly change my mapleader whenever I want/need to. 这样,我可以轻松避免踩踏默认映射,并且可以随时随地快速更改我的mapleader

Personally I have remapped my CAPSLOCK as CTRL 我个人已将我的CAPSLOCK映射为CTRL

and for vim 对于vim

imap jk <ESC>

The last trick has helped me a lot. 最后一个把戏对我有很大帮助。 I dont have to lift my fingers to get out from normal mode to insert mode . 我不必松开手指即可从normal mode退出到insert mode

And it works both ways, jk in normal mode is an innocent combination - move down one, move up one . 它可以双向工作,在normal modejk是无害的组合- move down one, move up one So by remapping jk as ESC you're not losing out anything. 因此,通过将jk重新映射为ESC您不会丢失任何内容。

Since the ESC key is the most used key in vim it beneficial to have it mapped somewhere else. 由于ESC键是vim中最常用的键,因此将其映射到其他位置会很有帮助。

I've seen others used Ctrl + [ , jj , ;; 我见过其他人使用Ctrl + [jj;; and for a secondary ESC key 和第二个ESC

imap  jj  <ESC>
imap  ;;  <ESC>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM