How do I visually select the next occurrence of my last search pattern?
gn
The gn motion searches forward for the next match of the last search pattern and visually selects it.
search #navigation #search #motions #normal-mode #repeat #editing
953 results for ":normal"
gn
The gn motion searches forward for the next match of the last search pattern and visually selects it.
search #navigation #search #motions #normal-mode #repeat #editing
:g/pattern/cmd1 | cmd2
The :g (global) command can execute multiple Ex commands per matching line by chaining them with .
command-line #command-line #global #ex-commands #batch-editing #advanced
"{register}y{motion}
Vim has 26 named registers (a-z) that act as independent clipboards.
registers #registers #editing #normal-mode #yank #productivity
<C-w>+ and <C-w>-
The + and - commands increase or decrease the height of the current split window by one line.
* (in visual mode)
In normal mode, searches for the word under the cursor with word-boundary anchors.
ma and 'a
The ma command sets a mark named a at the current cursor position.
z=
When spell checking is enabled, the z= command opens a numbered list of spelling suggestions for the misspelled word under the cursor.
editing #editing #spell-check #normal-mode #productivity #prose
cit
The cit command deletes everything between the nearest pair of HTML/XML tags and drops you into insert mode, ready to type the replacement.
:set concealcursor=nv
The 'concealcursor' option controls in which modes concealed text is revealed on the cursor line.
gcc
The vim-commentary plugin by Tim Pope provides a minimal yet powerful way to toggle comments in any programming language.
plugins #plugins #commentary #commenting #editing #normal-mode
` vs '
Vim offers two ways to jump to a mark, and the difference is crucial: the backtick (` `) jumps to the exact line and column where the mark was set, while the si
qaYp<C-a>q99@a
By recording a macro that duplicates a line and increments its number, you can generate a numbered list of any length with a single replay command.
macros #macros #editing #normal-mode #automation #productivity
qaqqa...@aq
A recursive macro calls itself at the end of its recording, creating a loop that repeats until a motion or command fails (like reaching the end of the file or f
<C-v>jjc replacement<Esc>
Visual block mode's change command lets you replace a rectangular column of text across multiple lines in a single operation.
visual-mode #editing #visual-mode #block-mode #normal-mode #productivity
mA / 'A
Uppercase marks (A-Z) are global marks — they remember not only the line and column position, but also the file where they were set.
navigation #navigation #marks #normal-mode #buffers #productivity
vim-repeat
The vim-repeat plugin by Tim Pope extends Vim's built-in .
plugins #plugins #repeat #dot-command #workflow #normal-mode
"1p then u.u.u.
Vim stores your last 9 deletions (of one line or more) in the numbered registers "1 through "9.
registers #registers #editing #normal-mode #undo-redo #paste
:g/pattern/command
The :g/pattern/command (global) command executes an Ex command on every line in the file that matches the given pattern.
{N}%
The {N}% command jumps the cursor to the line that is N percent of the way through the file.
:execute "command"
The :execute command evaluates a string expression and runs it as an Ex command.