Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display a ordered VIM keyboard mapping

Tags:

vim

Is there any away to show a ordered list of all keyboard mappings of my current vim environment, like this:

a: append
b: back one word
c: ...
.
.
.

---- Ctrl mappings ----
<C-a> (I dont know...)
.
.
.
<C-p> Default mode for CrtlP
...

---- Alt mappings ----
...

This will be very useful for me.

like image 473
daniloisr Avatar asked Dec 21 '12 12:12

daniloisr


1 Answers

:map and :verbose map show you a list of the mappings defined in your session, but they are not ordered like that. AFAIK, Vim doesn't provide such a nice formatting: you'll have to write a custom function for that, I'm afraid.

edit

Also, note that a, b and friends are not "mappings" in the sense that CtrlP's <C-p> is a mapping. :map won't show them at all.

So your idea, while interesting, is probably not something that can be done with a one liner. You could pull info from :h index, add the result of :map and try to arrange all of that in an order that makes sense to you but it doesn't seem to be a trivial task. It sounds like a perfect fit for a python/ruby/php script, doesn't it?

endedit

like image 121
romainl Avatar answered Nov 10 '22 13:11

romainl