Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect if a F# key is mapped on VIM

Tags:

vim

map

How can I view/list only the <F#> keys with :map? I need to know what <F#> is doing... Newbie here!

like image 707
Homem Robô Avatar asked Jun 20 '11 16:06

Homem Robô


3 Answers

Entering the following will list function key mappings for to :

:for i in range(1, 12) | execute("map <F".i.">") | endfor

If you add a "verbose", you will be told where the key mappings were defined:

:for i in range(1, 12) | execute("verbose map <F".i.">") | endfor

If you have more than 12 function keys, adjust the second parameter of the "range()" expression accordingly.

like image 66
Jeet Avatar answered Nov 06 '22 22:11

Jeet


you can just write

:map <F1>

to find out what the key is mapped to. I other mappings like the ones that start with \ you can type

:map \

and vim will list all mappings starting with \ for for the function keys I think you have to check them individually.

like image 2
skeept Avatar answered Nov 06 '22 23:11

skeept


:map (without arguments) shows all the maps available for n, v and o modes. For the other modes, try the correspondent command (for example :imap for insert mode).

Now it's just a matter of skimming the output looking for function key maps. If you give the command a specific key:

:nmap <F4>

That map will be presented.

like image 2
sidyll Avatar answered Nov 07 '22 00:11

sidyll