Marks (Bookmarks)
Jump back to positions in a file or across files with marks.
Code
ma " set mark 'a' at cursor (lowercase = local to buffer)
mA " set mark 'A' (uppercase = global, file-level)
'a " jump to line of mark a (linewise)
`a " jump to exact column of mark a
:marks " list marks in current buffer
:delmarks a " delete mark a
:delmarks! " delete all lowercase marks
" Built-in marks
`. " position of last change
`` " position before last jump (toggle)
`< `> " start/end of last visual selection
`[ `] " start/end of last yanked/pasted text
`^ " position of last insert-mode exitExplanation
Marks are named positions. Lowercase (a–z) are local to a buffer; uppercase (A–Z) are global and associate with the file — jump to 'B from any buffer and Vim opens the right file at the mark. 'a jumps linewise; `a jumps to the exact column. Built-in marks are extremely useful: `` toggles between the last two positions, `. goes to the last edit, `<`/`>` delimit the last visual selection (great for re-selecting an indent). Use marks in commands: :'a,'bs/old/new/g replaces between marks a and b.
More Vim Snippets
Buffers, Windows & Tabs
Edit multiple files with buffers, split windows, and tab pages.
Search & Substitute
Find text with / and replace with :s, leveraging regex and ranges.
Registers (Multi-Clipboard)
Store yanks/deletes in named registers and paste from them.
Macros (Recorded Keystrokes)
Record a sequence of keys and replay it to automate repetitive edits.
Folding (Collapse Code)
Hide regions of code to focus on structure with fold methods.
Plugin Managers & Ecosystem
Install, configure and discover plugins with vim-plug / packer / lazy.