Reputation: 705
I'm using the following command:
:imap <F1> ^P
to map F1 to Ctrl+P in the insert mode.
But it does not work.
Upvotes: 4
Views: 3167
Reputation: 172768
If that ^P
is two characters, ^
and P
, it's wrong. It has to be a single character (0x10), entered via CTRL-V CTRL-P
(or CTRL-Q CTRL-P
on many Windows versions of Vim, due to the remapping in mswin.vim
).
Better completely avoid these issues by using the special notation <C-P>
. Cp. :help keycodes
Oh, and when remapping built-in functionality, it's recommended to use noremap
:
:inoremap <F1> <C-P>
Upvotes: 6