When typing <Enter> in normal mode in Vim with the Tagbar plugin installed, the Tagbar window is opened automatically. I want to disable this functionality. What must I do?
vim: Tagbar windows opened when typing <Enter> in normal mode
299 views Asked by Long MaX At
3
Your mapping for
<C-m>
is actually the cause of the Enter key opening Tagbar. If you remove that map from your vimrc, the enter key will no longer trigger:TagbarToggle
.Mappings for
<C-m>
and<CR>
(Enter) are synonymous in Vim:This means when you set
nmap <C-m> :TagbarToggle<CR>
, it is the same as also settingnmap <CR> :TagbarToggle<CR>
.You'll probably want to choose a new key instead of M. The alternative is to change the key code sent by
<C-m>
at the operating system level with some remapping program.The terminal key bindings come from readline, the program that processes input text in your terminal prompt. A full list of key bindings is in the readline manual.
You can find more info about Vim key codes by typing
:help keycodes
in Vim, or reading the help docs here.