LucHermitte / lh-brackets

LH's bracketing system for vim
Other
50 stars 2 forks source link

Disable normal mode default bracket mappings #17

Closed skitimoon closed 6 years ago

skitimoon commented 6 years ago

I want to use the default vim key mappings in normal mode. But I cannot find a way to disable only some specific keymap ((, {). Only way to disable them is to disable all default mapping (g:cb_no_default_brackets). Is there a way to disable only some specific default keymap?

LucHermitte commented 6 years ago

(Sorry for the delay, I'm just back from holidays)

So far it isn't possible. Yet, it shouldn't be that complex to do. What I'd like to avoid is to introduce too much complexity.

I could provide 2 opposite configuration variables to tell what the plugin defines by default like for instance: :let g:cb_enable_default = { '(' : 'iv', '{', 'vn' } and/or :let g:cb_disable_default = { '(' : 'n', '{', 'i' }.

In the mean time another possibility is to add in ~/.vim/after/plugin/reset_bracket_defaults.vim things like:

nunmap (
nunmap {

However it won't be enough as some default mappings are buffer local mappings defined in lh-brackets/after/ftplugin/{ft}/{ft}_brackets.vim files.

LucHermitte commented 6 years ago

I've implement support for g:cb_enable_default and g:cb_disable_default in a separate branch. So far I haven't documented them. They can be tuned with: :let g:cb_enable_default = { '(' : 'iv', '{': 'vn' } or :let g:cb_disable_default = { '(' : 'n', '{', 'i' }.

You'll need to update lh-vim-lib to v4.5.0.

LucHermitte commented 6 years ago

Let me know if this patch answer your need. If so, I'll merge it into master branch.

skitimoon commented 6 years ago

Thanks for the update! It works as I expected. 👍

LucHermitte commented 6 years ago

Thanks. It's merged.