How do I progressively expand or contract a visual selection by text objects?
v3aw
In visual mode, repeating text object motions progressively expands the selection.
181 results for "n N"
v3aw
In visual mode, repeating text object motions progressively expands the selection.
:set formatoptions+=cro
The formatoptions setting controls how Vim automatically formats text as you type — including comment continuation, auto-wrapping, and paragraph formatting.
:call setreg('a', @a, 'l')
Registers in Vim have a type — characterwise, linewise, or blockwise — that affects how their contents are pasted.
/pattern1\_.*pattern2
Vim's \ modifier makes any character class match newlines too.
qa/pattern<CR>dd@aq
By starting a macro with a search command, the macro becomes conditional — it jumps to the next match before acting, and terminates when no more matches are f
:let &t_SI = "\e[6 q"
Modern terminals support cursor shape changes via escape sequences.
/foo\|bar
How it works The \ operator in Vim's search pattern works like a logical OR, letting you match any one of several alternatives.
:terminal ++curwin
By default, :terminal opens a new split window for the terminal emulator.
buffers-windows #terminal #buffers #windows #shell #ex-commands
<C-x>s
When spell checking is enabled (:set spell), s in insert mode opens a popup menu of suggested corrections for the most recently flagged misspelled word — with
<C-y> / <C-e>
When typing in insert mode, you can pull individual characters from adjacent lines without leaving insert mode.
:let @q =
Instead of recording a macro with q, you can assign any string directly to a named register using :let @{register} = 'keys'.
:'<,'>!command
How it works Vim can pipe selected text through any external shell command, replacing the selection with the command's output.
/\%>10c\%<20cpattern
When working with columnar data like CSV files, log files, or fixed-width records, you often need to match a pattern only when it appears in a specific column r
<C-x><C-o>
The keystroke triggers omni completion, Vim's built-in language-aware completion system.
:cexpr system('grep -rn pattern .')
While :make and :grep populate the quickfix list, they are limited to their configured programs.
:nnoremap <expr> j (v:count == 0 ? 'gj' : 'j')
Expression mappings use the flag to evaluate a Vimscript expression at the time the key is pressed.
:ilist /pattern/
The :ilist command searches for a pattern not only in the current buffer but also in files referenced by #include directives (or whatever 'include' is set to).
e
The e command moves the cursor to the last character of the current word.
qaq qa...@aq @a
A recursive macro calls itself at the end of its recording, causing it to repeat indefinitely until a command inside it fails (like a search hitting the end of
<C-o> / <C-i>
Vim maintains a jumplist — a history of every "jump" you make (searches, marks, gg, G, %, etc.