airblade / vim-gitgutter

A Vim plugin which shows git diff markers in the sign column and stages/previews/undoes hunks and partial hunks.
MIT License
8.38k stars 297 forks source link

Hardcoded key binds should be removed? #835

Closed smalinux closed 2 years ago

smalinux commented 2 years ago

First of all, thank you for this project. I apologize if this question is too simple.

I want to unbind(or remove them completely) all these binds because cause conflicts with my older binds: <leader>hp, <leader>hs, and <leader>hu Are there any plans to not hardcode them inside the plugin?

Thanks

bew commented 2 years ago

Hello! It is already possible to not map them

From the readme:

If you don't want vim-gitgutter to set up any mappings at all, use this:

let g:gitgutter_map_keys = 0

airblade commented 2 years ago

It's also worth knowing that GitGutter won't map <leader>hp, <leader>hs, and <leader>hu if they have already been mapped, nor if you have already mapped what they map to, i.e. <Plug>(GitGutterStageHunk) etc:

https://github.com/airblade/vim-gitgutter/blob/719d4ec06a0fb0aa9f1dfaebcf4f9691e8dc3f73/autoload/gitgutter.vim#L140-L151

smalinux commented 2 years ago

Thank you for the response. I mapped <leader>h for another plugin, so this bind was a little slow because nvim was waiting to see if it would be added another key after leader+h

Thanks