Detect if F # key is displayed on VIM

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

+6
source share
4 answers

Entering the following list displays the display of function keys for:

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

If you add “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 expression "range ()".

+6
source

you can just write

 :map <F1> 

to find out what the key is attached to. I have other mappings like the ones that start with \ , you can enter

 :map \ 

and vim will display all mappings starting with \ for function keys. I think you need to check them individually.

+2
source

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

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

 :nmap <F4> 

This card will be presented.

+2
source

To extend your Jeets solution by matching it in your .vimrc.

I always change the configuration of my function keys, so it’s very useful to be able to remind myself what's there.

Just enter f in normal mode to display the F1-F12 function keys

 :nnoremap ,f :for i in range(1, 12) <bar> execute("map <F".i.">") <bar> endfor 
0
source

Source: https://habr.com/ru/post/890942/


All Articles