All Projects → justinmk → Vim Sneak

justinmk / Vim Sneak

Licence: mit
The missing motion for Vim 👟

Programming Languages

Vim Script
2826 projects
Makefile
30231 projects

Projects that are alternatives of or similar to Vim Sneak

Vim Yoink
Vim plugin that maintains a yank history to cycle between when pasting
Stars: ✭ 225 (-90.88%)
Mutual labels:  plugin, viml, neovim, nvim
Vim Dirvish
Directory viewer for Vim ⚡️
Stars: ✭ 929 (-62.34%)
Mutual labels:  plugin, viml, neovim, nvim
Vim Subversive
Vim plugin providing operator motions to quickly replace text
Stars: ✭ 168 (-93.19%)
Mutual labels:  plugin, viml, neovim, nvim
Nvim Lspconfig
Quickstart configurations for the Nvim LSP client
Stars: ✭ 3,410 (+38.22%)
Mutual labels:  plugin, neovim, nvim
focus.nvim
Auto-Focusing and Auto-Resizing Splits/Windows for Neovim written in Lua. A full suite of window management enhancements. Vim splits on steroids!
Stars: ✭ 289 (-88.29%)
Mutual labels:  neovim, navigation, nvim
Vim Laravel
Vim support for Laravel/Lumen projects
Stars: ✭ 128 (-94.81%)
Mutual labels:  plugin, neovim
Nvimpager
Use nvim as a pager to view manpages, diffs, etc with nvim's syntax highlighting
Stars: ✭ 131 (-94.69%)
Mutual labels:  neovim, nvim
Shades Of Purple.vim
Dark theme for vim
Stars: ✭ 132 (-94.65%)
Mutual labels:  neovim, nvim
Aerojump.nvim
Aerojump is a fuzzy-match searcher/jumper for Neovim with the goal of quick keyboard navigation
Stars: ✭ 184 (-92.54%)
Mutual labels:  plugin, neovim
Acid.nvim
Asynchronous Clojure Interactive Development
Stars: ✭ 147 (-94.04%)
Mutual labels:  neovim, nvim
Nvcode
An IDE layer for Neovim with sane defaults. Completely free and community driven.
Stars: ✭ 6,714 (+172.15%)
Mutual labels:  neovim, nvim
Awesome Vim Colorschemes
Collection of awesome color schemes for Neo/vim, merged for quick use.
Stars: ✭ 1,951 (-20.92%)
Mutual labels:  neovim, nvim
Nvim Bqf
Better quickfix window in Neovim, polish old quickfix window.
Stars: ✭ 120 (-95.14%)
Mutual labels:  neovim, nvim
Paq Nvim
🌚 Neovim package manager
Stars: ✭ 131 (-94.69%)
Mutual labels:  neovim, nvim
Vim Qfreplace
Perform the replacement in quickfix.
Stars: ✭ 121 (-95.1%)
Mutual labels:  plugin, viml
Iris.vim
📫 Simple mail client for Vim.
Stars: ✭ 148 (-94%)
Mutual labels:  plugin, neovim
Darcula
A Vim color scheme reproduction of the official JetBrains IDE Darcula theme
Stars: ✭ 158 (-93.6%)
Mutual labels:  neovim, nvim
Vim Svelte
Vim syntax highlighting and indentation for Svelte 3 components.
Stars: ✭ 158 (-93.6%)
Mutual labels:  plugin, neovim
Nvim Config
My custom Neovim configuration with full battery for Python, C++, Markdown, LaTeX and more...
Stars: ✭ 176 (-92.87%)
Mutual labels:  neovim, nvim
Responsive Sidebar Navigation
An easy-to-integrate side, vertical navigation, ideal for dashboards and admin areas.
Stars: ✭ 111 (-95.5%)
Mutual labels:  plugin, navigation

sneak.vim 👟

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 (; and ,), keymaps, visual mode, multibyte text, and macros.

Try label-mode for a minimalist alternative to EasyMotion:

let g:sneak#label = 1

Usage

Sneak is invoked with s followed by exactly two characters:

s{char}{char}
  • Type sab to move 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 (or s again, if s_next is enabled; see :help sneak).
  • Type 3; to skip to the third match from the current position.
  • Type ctrl-o or `` to go back to the starting point.
    • This is a built-in Vim motion; Sneak adds to Vim's jumplist only on s invocation—not repeats—so you can abandon a trail of ; or , by a single ctrl-o or ``.
  • Type s<Enter> at any time to repeat the last Sneak-search.
  • Type S to search backwards.

Sneak can be limited to a vertical scope by prefixing s with a count.

  • Type 5sxy to go immediately to the next instance of "xy" within 5 columns of the cursor.

Sneak is invoked with operators via z (because s is taken by surround.vim).

  • Type 3dzqt to delete up to the third instance of "qt".
    • Type . to repeat the 3dzqt operation.
    • Type 2. to repeat twice.
    • Type d; to delete up to the next match.
    • Type 4d; to delete up to the fourth next match.
  • Type yszxy] to surround in brackets up to xy.
    • Type . to repeat the surround operation.
  • Type gUz\} to upper-case the text from the cursor until the next instance of the literal text \}
    • Type . to repeat the gUz\} operation.

Install

  • 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 .vim directory.

To repeat Sneak operations (like dzab) with dot ., repeat.vim is required.

FAQ

Why not use /?

For the same reason that Vim has motions like f and t: common operations should use the fewest keystrokes.

  • /ab<cr> requires 33% more keystrokes than sab
  • Sets only the initial position in the Vim jumplist—so you can explore a trail of matches via ;, then return to the start with a single ctrl-o or ``
  • 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

Why not use f?

  • 50x more precise than f or t
  • Moves vertically
  • Highlights matches in the direction of your search

How dare you remap s?

You can specify any mapping for Sneak (see :help sneak). By the way: cl is equivalent to s, and cc is equivalent to S.

How can I replace f with Sneak?

map f <Plug>Sneak_s
map F <Plug>Sneak_S

How can I replace f and/or t with one-character Sneak?

Sneak has <Plug> mappings for f and t 1-character-sneak. 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

Related

License

Copyright © Justin M. Keyes. Distributed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].