Jump to any location specified by two characters.
Sneak is a powerful, reliable, yet minimal motion plugin for Vim. It works with multiple
lines, operators (including repeat
. and surround), motion-repeat
,), keymaps, visual mode, multibyte text, and
Try label-mode for a minimalist alternative to EasyMotion:
let g:sneak#label = 1
Sneak is invoked with
s followed by exactly two characters:
sabto move the cursor immediately to the next instance of the text "ab".
;to go to the next match (or
s_nextis enabled; see
3;to skip to the third match from the current position.
``to go back to the starting point.
sinvocation—not repeats—so you can abandon a trail of
,by a single
s<Enter>at any time to repeat the last Sneak-search.
Sto search backwards.
Sneak can be limited to a vertical scope by prefixing
s with a count.
5sxyto go immediately to the next instance of "xy" within 5 columns of the cursor.
Sneak is invoked with operators
s is taken by surround.vim).
3dzqtto delete up to the third instance of "qt".
.to repeat the
2.to repeat twice.
d;to delete up to the next match.
4d;to delete up to the fourth next match.
yszxy]to surround in brackets up to
.to repeat the surround operation.
gUz\}to upper-case the text from the cursor until the next instance of the literal text
.to repeat the
git clone git://github.com/justinmk/vim-sneak.git ~/.vim/bundle/vim-sneak
To repeat Sneak operations (like
dzab) with dot
repeat.vim is required.
For the same reason that Vim has motions
t: common operations should use the fewest keystrokes.
/ab<cr>requires 33% more keystrokes than
;, then return to the start with a single
You can specify any mapping for Sneak (see
By the way:
cl is equivalent to
cc is equivalent to
map f <Plug>Sneak_s map F <Plug>Sneak_S
twith one-character Sneak?
<Plug> mappings for
These mappings do not invoke label-mode, even if you have it enabled.
map f <Plug>Sneak_f map F <Plug>Sneak_F map t <Plug>Sneak_t map T <Plug>Sneak_T
Copyright © Justin M. Keyes. Distributed under the MIT license.