mh21 / errormarker.vim

Highlights and sets error markers for lines with compile errors
http://www.vim.org/scripts/script.php?script_id=1861
31 stars 3 forks source link

Mapping <leader>cc collides with NERDCommenter plugin #5

Closed ImmanuelHaffner closed 4 years ago

ImmanuelHaffner commented 4 years ago

In https://github.com/mh21/errormarker.vim/blob/66ab8e0a356ea8a971e99156c59d09c3beae5ef2/plugin/errormarker.vim#L46 you use nmap to map <leader>cc. This collides with a mapping created by the NERDCommenter plugin. Shoudn't you use nnoremap here?

Same problem in https://github.com/mh21/errormarker.vim/blob/66ab8e0a356ea8a971e99156c59d09c3beae5ef2/plugin/errormarker.vim#L50

mh21 commented 4 years ago

Hi,

thank you for your bugreport.

How would using nnoremap solve the collision with the other plugin?

Cheers

Michael

ImmanuelHaffner commented 4 years ago

Oh, my mistake. I thought noremap does something else. I just looked it up in the documentation. Well, then maybe a configurable option would do it...?

I just found

let g:NERDCreateDefaultMappings = 0

that disables the creation of default mappings for NERDCommenter. For me this does the trick, since I don't use them anyways. Maybe you can do something similar?

ImmanuelHaffner commented 4 years ago

This StackOverflow question provides two other possible solutions: https://stackoverflow.com/questions/16218151/how-do-i-unmap-only-when-a-mapping-exists-in-vim

1) Suppress the warning! (IMHO a bad idea) 2) check the existence of the mapping

mh21 commented 4 years ago

You can use errormarker_disablemappings to disable the mappings in error marker.

ImmanuelHaffner commented 4 years ago

Thanks. The issue can be closed ;)