How do I open or close folds one level at a time across the entire file?
zr and zm
The zr and zm commands let you incrementally adjust the global fold depth across the entire buffer — one level at a time.
zr and zm
The zr and zm commands let you incrementally adjust the global fold depth across the entire buffer — one level at a time.
:lcd %:p:h
:lcd %:p:h sets the working directory for the current window to the directory of the file you're editing, using Vim's path expansion modifiers.
:set jumpoptions=stack
By default Vim's jump list is a ring: if you press to go back several positions and then make a new jump, the list wraps around and future entries are preserved
:set wildignore
:set wildignore defines a comma-separated list of glob patterns that Vim excludes from wildcard expansion and file completion.
:tabmove {n}
:tabmove {n} repositions the current tab page to index n in the tab bar (0-indexed from the left).
:set path^=./src
Vim's :set command supports three operators for modifying list-style options: += appends, -= removes, and ^= prepends.
:tjump
:tjump {identifier} is the smart tag-jumping command: it jumps directly when there is only one matching tag, but shows an interactive numbered list when multipl
:autocmd FileType python setlocal keywordprg=pydoc3
The K command looks up the word under the cursor using the program defined by keywordprg (default: man).
]c and [c
When files are open in Vim's built-in diff mode — whether via vimdiff, :diffsplit, or :diffthis — the ]c and [c motions let you jump precisely between chang
:set cursorbind
:set cursorbind (or :setlocal cursorbind) locks the cursor's column position so it moves in sync across all windows that have cursorbind enabled.
zR and zM
When working with a heavily folded file, manually opening or closing each fold is tedious.
{count}go
The go command moves the cursor to a specific byte offset from the start of the buffer.
'[ and ']
Vim automatically sets two special marks after every change, yank, or put operation: '[ and '].
mf and D (in netrw)
Vim's built-in file browser netrw (opened with :Explore or :Ex) supports a full file management workflow beyond simple navigation.
[z and ]z
The [z and ]z commands jump the cursor to the start and end of the innermost open fold containing the cursor.
gh (in netrw)
When browsing files with Vim's built-in netrw file explorer (:Explore or :Ex), hidden files starting with a dot (.
g8
Pressing g8 in normal mode displays the UTF-8 encoding of the character under the cursor as a sequence of hex bytes.
:split #
In Vim, # is a special filename that always refers to the alternate file — the most recently active buffer before the current one.
mA
Uppercase marks (A–Z) are global marks in Vim — they persist across files and even across sessions (when viminfo or shada is configured).
[i
Pressing [i in normal mode displays the first line above the cursor (including included files) that contains the keyword under the cursor.