python-rope / ropevim

vim mode that uses rope library to provide features like python refactorings and code-assists
GNU General Public License v2.0
245 stars 34 forks source link

How to disable shortcuts? #87

Open DanielLoney opened 3 years ago

DanielLoney commented 3 years ago

I tried doing let ropevim_enable_shortcuts=0 in my vimrc but the shortcuts are still being bound. How would I properly disable all shortcuts?

eivindjahren commented 1 year ago

I also tried this with both let ropevim_enable_shortcuts=0 and let g:ropevim_enable_shortcuts=0 and it seems to create the shortcuts in both cases. The switch to set the shortcuts is done here: https://github.com/python-rope/ropevim/blob/55fe3e2a848f3acd539f1c1892fd6116177c48d3/ropevim.py#L520-L521

and env.get does the magic of testing for existence and prepending g:ropevim_: https://github.com/python-rope/ropevim/blob/55fe3e2a848f3acd539f1c1892fd6116177c48d3/ropevim.py#L88-L95

It seems that env.get("enable_shortcuts") returns 0 and the noremap commands never executed, but the shortcuts are still available.

eivindjahren commented 1 year ago

Ah, I see now that the problem is that add_command does not respect enable_shortcuts.

https://github.com/python-rope/ropevim/blob/55fe3e2a848f3acd539f1c1892fd6116177c48d3/ropevim.py#L325-L331

This is as per the documentation, but it is subtle and not what the user expects.