VIM Disable plugin insertion display

The plugin adds mappings for my <leader>is to my inserts. I have some ideas that he might be. But it doesnโ€™t matter that I donโ€™t want to change anything in other people's plugins. Therefore, I want to disable this mapping. I tried this:

 imap <leader>is <nop> 

I did not help.

What are your suggestions?

By the way, I want to ask how to disable all plugin mapping insertions in vimrc?

+7
source share
2 answers

To remove the insert mode display, use the command :iunmap :

 :iunmap <Leader>is 

I donโ€™t know if mass unblocking can be done, but at least you can list all active displays in insert mode with

 :imap 

or, better yet, with

 :verbose imap 

which will also tell you exactly where the mapping was defined.


Edit: To clarify, you need to do unmapping after loading the plugin. To do this, create a file with the following contents in ~/.vim/after/plugin/ (see @ZyX's answer):

 " myafter.vim: will be executed after plugins have been loaded iunmap <Leader>is 
+10
source

Your command, if inserted into vimrc, is executed before the plugin defines an intrusive display, and therefore it has no effect. For this to have an effect, you must run it after this plugin, which is usually achieved by putting it in ~/.vim/after/plugin/disable_mappings.vim (any name instead of disable_mappings works). Secondly, the VimEnter event is VimEnter :

 augroup DisableMappings autocmd! VimEnter * :inoremap <leader>ic <Nop> augroup END 

. To disable all mappings, see :h 'paste' and :h 'pastetoggle' , also :h :imapclear (although the latter will remove the mappings instead of temporarily disabling them).


Of course, you can also use iunmap , where I suggested using inoremap โ€ฆ <Nop> . How did I forget this command?

+7
source

All Articles