Tuesday, October 25, 2016

Three Minutes Daily Vim Tip: Disable F1 Key

<F1> is by default mapped to vim help, but this is rather annoying, especially when I have mapped <F2> and <F3> for switching between tabs. Here is how to disable <F1> key mapping in vim.

Simply add these two lines of codes into ~/.vimrc:

nmap <F1> :echo<CR>

imap <F1> <C-o>:echo<CR>

Note: if you using GNOME, then F1 is snatched by GNOME before vim, in which case you will likely get some help menu even if you have disabled F1 from vim. IN this case, simply disable F1 from the terminal --> preferences --> shortcuts --> help --> backspace.