How do I resize a split window by an exact number of columns or rows using a count in Vim?
{n}<C-w>>
All four window resize mappings accept an optional count prefix that multiplies the resize amount.
415 results for "n N"
{n}<C-w>>
All four window resize mappings accept an optional count prefix that multiplies the resize amount.
z{N}<CR>
The z{N} command sets the current window's height to exactly N lines and simultaneously positions the current line at the top of the window.
ciw + new text + Esc, then n.
The ciw command followed by new text, combined with and .
:sort! n
The :sort! n command sorts the lines of a buffer (or a range) by their numeric value in descending order.
]n
During a git merge, Vim can navigate directly between conflict markers (>>>>>>) using ]n and [n.
<C-n> to select (vim-visual-multi)
vim-visual-multi provides VS Code-style multiple cursor support for Vim.
:resize N / :vertical resize N
The :resize and :vertical resize commands set a window to an exact number of lines or columns.
:call feedkeys("iHello\<Esc>", 'n')
The feedkeys() function injects keystrokes into Vim's input buffer as if the user typed them.
:%s/pattern//n
The n flag in the substitute command suppresses the actual replacement and instead reports the match count.
:'<,'>sort n
By default, :sort in Vim uses lexicographic (alphabetical) ordering, so "10" sorts before "2" because "1" sort n — sort selected lines by the leading number,
:%sort /[^,]*,/ n
Vim's :sort command accepts a pattern that controls which part of each line is used as the sort key.
:%s/\n/ /g
Using \n in the pattern of :substitute matches the newline character at the end of each line, letting you join lines with any separator you choose — something
:'<,'>!awk '{printf "%-20s %s\n", $1, $2}'
By piping a visual selection through awk with printf formatting, you can align columns to fixed widths.
visual-mode #visual-mode #formatting #alignment #external-command
:tabmove {n}
:tabmove {n} repositions the current tab page to index n in the tab bar (0-indexed from the left).
:sbuffer {N}
:sbuffer {N} opens buffer number N in a new horizontal split, leaving your current window untouched.
buffers-windows #buffers-windows #buffers #windows #navigation
<C-x><C-n>
triggers keyword completion that searches only the current buffer for matches, scanning forward from the cursor.
:%s/,/,\r/g
In Vim substitutions, \n and \r behave differently depending on whether they appear in the search pattern or the replacement string — a common gotcha that sur
:'<,'>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
:%s/\n\{3,}/\r\r/g
When files pass through formatters, generators, or repeated edits, they often accumulate noisy vertical gaps.
:'<,'>sort n /\d\+/
Plain :sort n is useful, but it only works when the numeric key starts at the beginning of each line.
visual-mode #visual-mode #sorting #ex-commands #text-processing