inkarkat / vim-mark

Highlight several words in different colors simultaneously.
http://www.vim.org/scripts/script.php?script_id=2666
266 stars 32 forks source link

Support mark_no_mappings to not map anything #16

Closed idbrii closed 5 years ago

idbrii commented 5 years ago

The problem with hasmapto is that it requires users to map all possible commands -- even if they're only interested in MarkSet and MarkAllClear.

Users can now let g:mark_no_mappings = 1 and set only the mappings they desire.

CharlesGueunet commented 5 years ago

Maybe you should add an entry in the doc for this feature. Definitely a must have for this plugin !

idbrii commented 5 years ago

Updated with doc and fixed variable name.

inkarkat commented 5 years ago

Thanks a lot; you're right, this plugin now has so many default mappings that a simple way to disable all of them is really needed.

Somehow, the readme additions didn't make it into this pull request, and I chose to implement this slightly different (using :finish instead of a conditional, and naming the variable g:mw_no_mappings to be consistent with the original (though wrong) naming scheme). Oh, and some mappings are generated dynamically in s:MakeDirectGroupMappings(), so we needed a check in there, too.

Thanks again, and keep up the good work!