How do I merge consecutive edits so they undo in a single step?
:undojoin<CR>
By default, separate edits often become separate undo entries, which makes replaying or backing out a multi-part change noisy.
254 results for ":split"
:undojoin<CR>
By default, separate edits often become separate undo entries, which makes replaying or backing out a multi-part change noisy.
"#p
The # register holds the name of the alternate file — the file you were editing just before the current one.
:set switchbuf=useopen,usetab,newtab
When jump commands open files (:tag, quickfix navigation, location list jumps), Vim may split your layout in ways that break flow.
:windo diffthis | wincmd =<CR>
When you already have multiple related buffers open, you can enter diff mode across all visible windows in one shot and then normalize layout width/height immed
systemlist()
systemlist({cmd}) runs a shell command and returns the output as a list of strings, one per line — unlike system() which returns everything as a single string
:lvimgrep /{pattern}/j ## | lopen
When you need to run focused searches across a curated set of files, the argument list is a strong scope boundary.
:arglocal
By default, Vim's argument list is global, so changing it in one window can unexpectedly affect another workflow in a different tab or split.
g<C-g> (visual mode)
In visual mode, pressing g reports detailed statistics for the selected text only — word count, character count, and byte count.
:cexpr system('rg --vimgrep "TODO"')
When you already know you want an external search tool, :cexpr lets you import results directly into quickfix without opening a terminal buffer or shelling out
:vimgrep /\<TODO\>/gj **/*.lua | copen
When you want a project-wide TODO pass without leaving Vim, :vimgrep plus quickfix is a strong built-in workflow.
search #search #quickfix #command-line #project-navigation #ex-commands
:pedit +/TODO %
When you need a second read-only view of the same file, opening more normal splits can disrupt your working layout.
:lvimgrep /pattern/gj **/*.js | lopen
When you already rely on the global quickfix list for compiler errors or another search, running :vimgrep can wipe that context.
\n in search, \r in replacement
Vim uses \n and \r differently depending on whether they appear in a search pattern or a replacement string, and mixing them up is a common source of confusion.
<C-z> / :stop
Pressing in Vim sends it to the background of your shell session — just like suspending any Unix process.
:%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/,/,\r/g
In Vim's :substitute command, \r in the replacement string inserts a literal newline — it splits the line at that point.
:s/\n/ /
One of the most confusing asymmetries in Vim's substitution syntax: \n and \r mean different things depending on whether they appear in the pattern or the repla
:set diffopt+=vertical,algorithm:patience,indent-heuristic
Default diff behavior can look noisy on refactors where blocks move or indentation shifts.
:keepalt edit path/to/file\<CR>
Experienced Vim workflows often depend on the alternate file (#) for fast toggling with , quick diffs, or two-file review loops.
:set wildignorecase
:set wildignorecase makes Vim's command-line tab completion treat uppercase and lowercase letters as equivalent when completing file names, buffer names, and ot