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

sneak next with ; remapped #19

Closed
jayflo opened this issue Oct 29, 2013 · 4 comments
Closed

sneak next with ; remapped #19

jayflo opened this issue Oct 29, 2013 · 4 comments

Comments

@jayflo
Copy link

jayflo commented Oct 29, 2013

I have the following bindings in my .vimrc

let mapleader=","
nnoremap ; :
nnoremap : ;

When after using s{char}{char}, pressing : (nor ; ...of course) does not work move to the next instance. I've also tried binding : to SneakNext and VSneakNext, neither of which work. What am I doing incorrectly?

@justinmk
Copy link
Owner

If I understand correctly, you want : to be your "go to next match" key.

First you need to remove the last line, because what's it's telling Vim to do is:

Make : act like the Vim default ;

But what we really want is to let Sneak manage : so your full settings will look like this:

let mapleader=","
nnoremap ; :
nmap : <Plug>SneakNext
xmap : <Plug>VSneakNext

The xmap line is for visual-mode. You can remove it if you don't want : to go to the next match in visual-mode.

Edited to remove copy-paste oops.

@justinmk
Copy link
Owner

Note that it is very important to use nmap instead of nnoremap for <Plug> mappings because <Plug> mappings are inherently recursive. It makes no sense to tell Vim to non-recursively map a <Plug> mapping.

@jayflo
Copy link
Author

jayflo commented Oct 29, 2013

Thank you so much for your quick response! It's a great plugin!

@justinmk
Copy link
Owner

You're welcome! Thanks for the feedback.

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