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

Usage with vim-sneak #60

Open
simonweil opened this issue Aug 6, 2015 · 7 comments
Open

Usage with vim-sneak #60

simonweil opened this issue Aug 6, 2015 · 7 comments

Comments

@simonweil
Copy link

Hi,
Is use justinmk/vim-sneak for quite a while and I'm used to using s for the sneak motions.
How would I map the s in easyclip to some other key?
Thanks,
Simon

@svermeulen
Copy link
Owner

This should work fine, since the mapping for s is disabled by default with easy clip. The options section of the ReadMe covers how to map different keys to different operations. For example, if you want to use gs for substitute, include this in your vimrc:

nmap <silent> gs <plug>SubstituteOverMotionMap
nmap gss <plug>SubstituteLine
xmap gs <plug>XEasyClipPaste

@simonweil
Copy link
Author

Oh, OK thanks, I use (neo)vim, but I'm not really a pro in VimL and the configuration.
I'll reopen if I have any issues.
Thank again :)

@svermeulen
Copy link
Owner

There's some outstanding neovim specific issues (eg: #55) so feel free to log any other ones you see. I need to upgrade to neovim and take a look at these soon.

@simonweil
Copy link
Author

I installed the plugin and the s mapping is overridden by easyclip although I didn't enable it.

Typing :map s gives me:

s  s           * <C-O>"_cs
x  s           * "_s
n  s           * "_s

So it isn't setting the substitute commands but still remapping to vim's s with the blackhole which I really want remapped to sneak's mappings. This is what I expect to see:

x  s             <Plug>Sneak_s
n  s             <Plug>Sneak_s

Please help me get my sneak mapping back with easyclip installed. :)

@simonweil simonweil reopened this Aug 9, 2015
@svermeulen
Copy link
Owner

Yes I see what you mean. Easyclip will only override the s mappings if it isn't already mapped to something. I've noticed that vim-sneak does the same thing, so I think the easiest way to fix this would be to initialize vim-sneak before vim-easyclip, so that its mappings take precedence.

If you're using NeoBundle, this is just a matter of placing these lines in this order:

NeoBundle 'justinmk/vim-sneak'
NeoBundle 'svermeulen/vim-easyclip.git'

@simonweil
Copy link
Author

Well this solved it for me but I would rather have a more elegant solution such as an option to disable the s mapping.
Would you accept such a pull request?

@svermeulen
Copy link
Owner

Sure.

If you look at BlackHole.vim you can see what it's doing there. You could set g:EasyClipEnableBlackHoleRedirectForChangeOperator to 0 but then you'd still have to remap all the other change keys so that's not great. I don't think having a boolean flag for each specific key is very good either, so maybe instead we could provide an easy clip setting for a list of strings that we'd use to ignore certain bindings

This is really only a problem when two plugins disagree on a mapping, since if there's a vimrc mapping then easy clip will always respect that. But still could be useful.

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