How do I jump back to where the cursor was when I last left a buffer?
`"
The " mark is an automatic mark Vim sets whenever you leave a buffer — switching to another file, hiding the buffer, or quitting Vim (with viminfo/shada enabl
170 results for ":help"
`"
The " mark is an automatic mark Vim sets whenever you leave a buffer — switching to another file, hiding the buffer, or quitting Vim (with viminfo/shada enabl
:tabdo only
When you are deep in a refactor, each tab can accumulate helper splits, previews, and temporary views.
buffers-windows #buffers #windows #tabs #ex-commands #workflow
:packadd termdebug | Termdebug ./a.out
If you only debug occasionally, loading termdebug on demand keeps startup lean while still giving you an in-editor GDB workflow.
g&
The g& command repeats the last substitute command across the entire file.
\@>
Vim's \@> syntax creates an atomic group in a regular expression.
/\%>10l\%<20lpattern
Vim's \%>Nl and \%10l matches only after line 10 \%10l\%10l\%<20lold/new/g Combine with column restrictions for precise region targeting Tips Line numbers in \%
gh (in netrw)
When browsing files with Vim's built-in netrw file explorer (:Explore or :Ex), hidden files starting with a dot (.
]# and [#
Vim provides the ]# and [# motions specifically for navigating C preprocessor conditionals.
set colorcolumn=+1
The colorcolumn option highlights one or more vertical columns to help keep lines within a length limit.
/colour\%[s]
Vim's \%[.
set nrformats+=alpha
By default, Vim's and commands only increment and decrement numbers (decimal, hex, binary).
:%s/,/\r/g
In Vim's substitute command, \r in the replacement string inserts a newline.
autocmd ++once
The ++once flag, added in Vim 8.
[[:alpha:]]
Vim's regex engine supports POSIX character classes inside bracket expressions, giving you locale-aware, readable alternatives to manual character ranges like [
g<
Pressing g or q to dismiss it again Example Tips :messages also shows recent messages (and those accumulate across the session), while g< only shows the last pa
:TOhtml
The :TOhtml command converts the current buffer — complete with its syntax highlighting colors — into a standalone HTML file.
{N}|
The command (pipe character) moves the cursor to a specific column number on the current line.
yos, yow, yol, yon, yoh
The vim-unimpaired plugin adds a set of paired bracket mappings, including a powerful family of option toggles.
"1p ... "2p ... "9p
Vim maintains a numbered register history from "1 through "9 that stores your last 9 deletes and changes.
:source % or :'<,'>source
The :source command executes Vimscript from a file.
command-line #command-line #vimscript #workflow #development