Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README "override yet replicate the default mappings" is misleading #18

Open
Paul-Aime opened this issue Nov 5, 2021 · 1 comment
Open

Comments

@Paul-Aime
Copy link

In the README is the following:

For example, to override yet replicate the default mappings you would define, the following in ~/.vim/ftplugin/python/pythonsense-custom.vim:

map <buffer> ac <Plug>(PythonsenseOuterClassTextObject)
map <buffer> ic <Plug>(PythonsenseInnerClassTextObject)
map <buffer> af <Plug>(PythonsenseOuterFunctionTextObject)
map <buffer> if <Plug>(PythonsenseInnerFunctionTextObject)
map <buffer> ad <Plug>(PythonsenseOuterDocStringTextObject)
map <buffer> id <Plug>(PythonsenseInnerDocStringTextObject)

...

So I did override all the keybindings, even if only modifying a few, so to have them all in one place to read.

However this does not replicate the default behavior, because map also apply to normal mode whereas default mappings are only omap and vmap (as I can tell by reading pythonsense.vim source code).

And all those mappings begin with i or a, which from normal mode make you go into insert mode.
So it introduces lag, or even bug, e.g. when typing idef to enter insert mode and starting to define a function, nothing will happen.

Maybe a note should be added on that in the README.

Btw, thanks for the great plugin!

@Hubro
Copy link

Hubro commented Mar 17, 2022

Thank you! This was exactly what I was going to report. I've never heard of "omap" and "vmap" before, so I wouldn't have figured this out on my own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants