- Notifications
You must be signed in to change notification settings - Fork90
The missing motion for Vim 👟
License
justinmk/vim-sneak
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Jump to any location specified by two characters.
Sneak is a powerful, reliable, yet minimalmotion plugin for Vim. It works withmultiplelines,operators (including repeat. andsurround), motion-repeat(; and,),keymaps,visual mode,multibyte text, andmacros.
Trylabel-mode for a minimalist alternative toEasyMotion:
letg:sneak#label=1
Sneak is invoked withs followed by exactly two characters:
s{char}{char}- Type
sabtomove the cursor immediately to the next instance of the text "ab".- Additional matches, if any, are highlighted until the cursor is moved.
- Type
;to go to the next match (orsagain, ifs_nextis enabled; see:help sneak). - Type
3;to skip to the third match from the current position. - Type
ctrl-oor``to go back to the starting point.- This is a built-in Vim motion; Sneak adds to Vim'sjumplistonly on
sinvocation—not repeats—so you canabandon a trail of;or,by a singlectrl-oor``.
- This is a built-in Vim motion; Sneak adds to Vim'sjumplistonly on
- Type
s<Enter>at any time to repeat the last Sneak-search. - Type
Sto search backwards.
Sneak can be limited to avertical scope by prefixings with acount.
- Type
5sxyto go immediately to the next instance of "xy" within 5 columnsof the cursor.
Sneak is invoked withoperatorsviaz (becauses is taken by surround.vim).
- Type
3dzqtto delete up to thethird instance of "qt".- Type
.to repeat the3dzqtoperation. - Type
2.to repeat twice. - Type
d;to delete up to the next match. - Type
4d;to delete up to thefourth next match.
- Type
- Type
yszxy]tosurround in brackets up toxy.- Type
.to repeat the surround operation.
- Type
- Type
gUz\}to upper-case the text from the cursor until the next instanceof the literal text\}- Type
.to repeat thegUz\}operation.
- Type
Requires Vim 7.3+ orNvim. Label-mode requires Vim7.4.792+. With Nvim 0.5+ label-mode is driven byvirtual textinstead of the legacy "conceal" feature.
- vim-plug
Plug 'justinmk/vim-sneak'
- Pathogen
git clone git://github.com/justinmk/vim-sneak.git ~/.vim/bundle/vim-sneak
- Manual installation:
- Copy the files to your
.vimdirectory.
- Copy the files to your
To repeat Sneakoperations (likedzab) with dot.,repeat.vim is required.
For the same reason that Vim hasmotionslikef andt: common operations should use the fewest keystrokes.
/ab<cr>requires 33% more keystrokes thansab- Setsonly the initial position in the Vim jumplist—so you can explore atrail of matches via
;, then return to the start with a singlectrl-oor`` - Doesn't clutter your search history
- Input is always literal (don't need to escape special characters)
- Ignores accents ("equivalence class") when matching(#183)
- Smarter, subtler highlighting
- 50x more precise than
fort - Moves vertically
- Highlights matches in the direction of your search
You can specify any mapping for Sneak (see:help sneak).By the way:cl is equivalent tos, andcc is equivalent toS.
mapf<Plug>Sneak_smapF<Plug>Sneak_S
Sneak has<Plug> mappings forf andt 1-character-sneak.These mappings donot invoke label-mode, even if you have it enabled.
mapf<Plug>Sneak_fmapF<Plug>Sneak_Fmapt<Plug>Sneak_tmapT<Plug>Sneak_T
- Seek
- EasyMotion
- smalls
- improvedft
- clever-f
- vim-extended-ft
- Fanf,ingTastic;
- IdeaVim-Sneak
- leap.nvim
- flash.nvim
Copyright © Justin M. Keyes. Distributed under the MIT license.
About
The missing motion for Vim 👟
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
