How do I find the next occurrence of my search pattern?
n
After performing a search with / or ?, pressing n repeats the search in the same direction to find the next match.
181 results for "n N"
n
After performing a search with / or ?, pressing n repeats the search in the same direction to find the next match.
/pattern/+N or /pattern/-N
Vim's search command accepts an offset that places your cursor on a line relative to the match.
:resize +N / :resize -N
:resize adjusts the height of the current window by a relative or absolute amount.
/pattern\{3}
Vim supports counted quantifiers that let you specify exactly how many times a pattern should repeat.
:keeppatterns %s/old/new/g
The :keeppatterns modifier runs any Ex command without modifying Vim's last search pattern (stored in @/).
command-line #search #ex-commands #command-line #substitute #registers
:'<,'>s/\n/, /g
Vim's J command joins lines with a single space, but sometimes you need a custom separator like a comma, pipe, or semicolon.
editing #editing #ex-commands #visual-mode #substitution #lines
:earlier
Vim's undo history is not just a linear list of changes — it records timestamps too.
ciw + new text + Esc, then n.
The ciw command followed by new text, combined with and .
<C-n> to select (vim-visual-multi)
vim-visual-multi provides VS Code-style multiple cursor support for Vim.
/pattern/+3
Vim's search command accepts an offset after the pattern that shifts where the cursor lands relative to the match.
gd / gr / <leader>rn with nvim-lspconfig
The Language Server Protocol (LSP) brings IDE-level intelligence to Neovim — go-to-definition, find references, rename symbol, and more.
:%sort /[^,]*,/ n
Vim's :sort command accepts a pattern that controls which part of each line is used as the sort key.
:call feedkeys("iHello\<Esc>", 'n')
The feedkeys() function injects keystrokes into Vim's input buffer as if the user typed them.
/pattern\n next-line
Using \n in a Vim search pattern matches a newline character, allowing you to find patterns that cross line boundaries.
:%s/,/\r/g
In Vim's substitute command, \r in the replacement string inserts a newline.
<C-n> / <C-p>
Vim has a powerful built-in completion system that requires zero plugins.
:s/,/,\r/g
In Vim's :substitute command, \r in the replacement string inserts a literal newline — it splits the line at that point.
#
The # command searches backward for the exact word under the cursor, jumping to the previous occurrence.
:s/,/\r/g
In Vim's substitute command, use \r (not \n) in the replacement to insert a real newline.
:%s/pattern/\r/g
In the replacement part of :s, \r inserts a newline.