I'm using the following command:
:imap <F1> ^P
to map F1 to Ctrl+P in the insert mode.
But it does not work.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With