Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't remove mapping from VIM?

Tags:

vim

My vim configuration is adding some really annoying mappings for the sql filetype that conflict with my own.

I can verify it with the following command:

:imap <C-c>a

i  <C-C>a      *@<C-\><C-O>:call sqlcomplete#Map("syntax")<CR><C-X><C-O>

I want to remove it, but if any way I try it fails:

:unmap <C-C>a
E31: No such mapping

:iunmap <C-C>a
E31: No such mapping

I can clearly see that the mapping exist so why is it telling me that it doesn't?

like image 835
Juan Enrique Muñoz Zolotoochin Avatar asked Oct 01 '22 01:10

Juan Enrique Muñoz Zolotoochin


1 Answers

The * in the :imap output gives it away: This is a buffer-local mapping, so in order to unmap it, you also need to specify the <buffer> attribute:

iunmap <buffer> <C-C>a

To undo the ftplugin mapping for all sql buffers, put this into ~/.vim/after/ftplugin/sql.vim.

like image 108
Ingo Karkat Avatar answered Oct 13 '22 02:10

Ingo Karkat