VIM: available shortcuts?

[亡魂溺海] 提交于 2019-12-20 08:49:37

问题


I use many shortcuts for my work in vim. Other shortcuts are taken by plugins.

Sometimes I would like to add a shortcut for a new command but note afterwards that the shortcut was already taken.

Is there a way to see a list of all available shortcuts in VIM? (all ctrl-shift-alt shortcuts)


回答1:


Type :help index to see the mappings (shortcuts as you name them) and commands defined by vim itself.

Type :map to see the mappings defined by your vimrc and plugins. Type :verbose map to know where each mapping was defined.

Also :help map-listing to check what's displayed, but you probably already know about it (it's in map.txt help manual).




回答2:


If you also want to check which maps or commands are defined by vim itself you can use

:help index



回答3:


:map //lists all the shortcuts that are assigned.

map also takes a key combination as an argument that lists only the shortcuts assigned to this key combination.

To list all the mappings assigned for Ctrl-V:

:map <c-v>



回答4:


I found this helpful...

http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html




回答5:


If you want a sorted, searchable list of your current mappings to look for unused keys, see my answer at: How to search in the Vim mapping listing?

As a starting point, for the keys are not mapped by default, see :help map-which-keys

You can use :map < key > to check a specific mapping. Example: to check Shift-F2, :map S-<F2>.

AFAIK, there's no way of getting a list of what's unmapped without writing code to iterate through each possible key combination and check if there is any output from running :map < key > for that particular key.



来源:https://stackoverflow.com/questions/5390683/vim-available-shortcuts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!