This is probably due to the fact that your TERM type is set to something other than xterm xterm-color or xterm-256color. I had my Linux kit, for some reason I canβt remember. This caused function keys to send escape sequences instead of being interpreted as function key presses. those. F2 sent ^[OQ instead of <F2> .
If you need this type of terminal, you can change your .vimrc to use the necessary key by pressing <ctrl-v><F2> instead of entering <F2>
A simpler solution, of course, is simply to change the terminal type to something that allows vim to work without jumping through hoops.
source share