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

Check if <plug> has been assigned with hasmapto() #106

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Check if <plug> has been assigned with hasmapto() #106

wants to merge 3 commits into from

Conversation

mg979
Copy link

@mg979 mg979 commented Sep 6, 2018

Using - as a prefix for other mappings leads to often bring up vinegar when it shouldn't. Basically it's impossible to have - unmapped with the current setup.

@tpope
Copy link
Owner

tpope commented Sep 6, 2018

I think using mapcheck() would be the most appropriate solution here.

@mg979
Copy link
Author

mg979 commented Sep 6, 2018

As you prefer. So I should use mapcheck()? Should I add a note in the docs?

@tpope
Copy link
Owner

tpope commented Sep 6, 2018

Yes replace empty(maparg()) with mapcheck(). Hopefully a note in the docs will be unnecessary.

@mg979
Copy link
Author

mg979 commented Sep 6, 2018

First commit: only mapcheck()
Second commit: doc update
Third commit: checking both mapping and plugs, so that one can map a plug and leave - unmapped, if he really wants to. But maybe it's overdone.

You can drop the last two commits if you think it's unnecessary. Thanks

@tpope
Copy link
Owner

tpope commented Sep 10, 2018

A boolean is returned from mapcheck() so you don't need empty(). I'm just going to go with the first commit for now.

@mg979
Copy link
Author

mg979 commented Sep 11, 2018

Ok. You can consider this more an issue than a PR. Since you're there, you might consider to add a

nmap     <buffer><nowait> - <Plug>VinegarUp

in s:setup_vinegar() so that - works in the netrw buffer, so that at least there it works as designed. I added it because if I have a reason to use -- outside of netrw, there's no reason not to use - inside of it. Thanks

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

Successfully merging this pull request may close these issues.

None yet

2 participants