Skip to content

Instantly share code, notes, and snippets.

View mgarort's full-sized avatar

Miguel García-Ortegón mgarort

View GitHub Profile
@LanHikari22
LanHikari22 / vim-sneak - use s in operator mode.vim
Created February 15, 2021 01:17
Remap vim-surround to 'z' to allow vim-sneak to use 's' in operator mode
" documentation and source are credited to https://github.com/mgarort
" Make vim-sneak mappings more consistent in visual mode by making s go to next match and S
" go to previous match, while keeping vim-surround functionality through z
" (mnemonics: vim-zurround) Explained in this GitHub issue:
" https://github.com/justinmk/vim-sneak/issues/268
"
" So now the behaviour is:
" - Normal: s and S to move with sneak
" - Visual: s and S to move with sneak, z to surround (zurround)
@romainl
romainl / pseudo-text-objects.md
Last active March 3, 2025 06:04
Custom pseudo-text objects

This is a list of custom pseudo-text objects for Vim.

Note the use of "pseudo", here. Conceptually, text object are "special" motions but there is no proper mechanism dedicated to creating text objects, specifically. We are left with the generic mechanism succinctly described under the easy-to-miss :help omap-info.

Writing one's own pseudo-text objects and motions is a great way to extend Vim without perverting its nature ;-).


My Vim-related gists.