How do I apply an Ex command only to the exact range of my last change or yank?
When you need to run a command on exactly the text you just changed, yanked, or pasted, Vim's automatic marks are faster and safer than reselecting manually.
category:
command-line
tags:
#command-line
#marks
#indentation
#ex-commands
#normal-mode
How do I indent the current line without changing local marks in Vim?
When you run editing commands from the command line, Vim usually updates special marks like '[ and '] to the changed text.
category:
editing
tags:
#editing
#ex-commands
#marks
#normal-mode
How do I uppercase a word and then jump back to my exact original cursor position?
When you run an operator like gUiw, Vim can leave your cursor in a slightly different place than where you started.
category:
editing
tags:
#editing
#marks
#motions
#normal-mode
How do I execute a command without changing '[ and '] marks in Vim?
Many batch edits in Vim update special marks like '[ and '], which can disrupt follow-up motions or tooling that depends on those positions.
category:
navigation
tags:
#navigation
#marks
#command-line
#refactoring
#editing
How do I jump to the next lowercase mark in Vim's mark order?
Most users jump to marks directly ('a, ` a `), but when a file has many lowercase marks, stepping through them in order is faster than remembering each name.
category:
navigation
tags:
#navigation
#marks
#motions
#workflow
How do I run a macro only between two marks without entering Visual mode?
When you need to replay a macro on a precise region, selecting lines manually can be slow and error-prone.
category:
macros
tags:
#macros
#marks
#command-line
#normal-mode
How do I keep more marks and registers across sessions by tuning the shada option?
:set shada='200,<1000,s100,h
Default ShaDa settings are conservative, which can make long-running workflows lose useful context between sessions.
category:
config
tags:
#config
#shada
#registers
#marks
#session
How do I jump back to the previous context line without preserving exact column?
When you jump around a file, Vim tracks prior locations.
category:
navigation
tags:
#navigation
#motions
#marks
#jumplist
#normal-mode
How do I jump back to the exact cursor position from my last Vim session?
Vim automatically saves your cursor position when you exit, storing it as the 0 mark in the viminfo file (or shada file in Neovim).
category:
navigation
tags:
#navigation
#marks
#viminfo
#shada
#sessions
How do I run a substitution without displacing my marks?
:keepmarks %s/pattern/replacement/g
The :keepmarks modifier prevents Vim from adjusting mark positions when a buffer-modifying command runs.
category:
search
tags:
#marks
#search
#editing
#ex-commands
How do I write a Vim search pattern that matches text at or between mark positions?
Vim's \%'m regex atom matches the exact position of mark m in a search pattern.
category:
search
tags:
#search
#marks
#navigation
#ex-commands
#normal-mode
How do I use a named mark as a motion target for operators like delete, yank, or indent in Vim?
Named marks are not just jump destinations — they serve as motion targets for any operator.
category:
navigation
tags:
#navigation
#marks
#editing
#motions
#normal-mode
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
category:
navigation
tags:
#navigation
#marks
#buffers
How do I restrict a substitution to the range between two named marks?
Named marks can serve as range endpoints for any Ex command, including :substitute.
category:
search
tags:
#search
#marks
#substitution
#ex-commands
#editing
How do I run a substitute or filter command without Vim automatically repositioning my marks?
When Vim executes commands that move or reorder lines — such as :sort, :%!sort, or :s/// across ranges — it automatically adjusts named marks to follow the
category:
command-line
tags:
#ex-commands
#marks
#editing
#normal-mode
How do I use the caret mark to jump to the exact cursor position where I last left insert mode?
Vim automatically maintains a special mark ^ that records the exact position of the cursor the last time you left insert mode.
category:
navigation
tags:
#navigation
#marks
#insert-mode
#normal-mode
How do I jump forward and backward through all marks in the current buffer?
The ]' and [' motions let you traverse every lowercase mark set in the current buffer without needing to remember which registers you used.
category:
navigation
tags:
#navigation
#marks
#motions
#normal-mode
How do I delete all lowercase marks in the current buffer at once?
Marks accumulate as you work — ma, mb, mc and so on record positions for later jumps.
category:
navigation
tags:
#navigation
#marks
#editing
#ex-commands
How do I manually add the current position to the jump list before making a large movement?
Vim's jump list automatically records your position whenever you make large motions (like G, /pattern, or ).
category:
navigation
tags:
#navigation
#marks
#normal-mode
How do I use Harpoon to bookmark project files and jump between them instantly?
:lua require('harpoon.mark').add_file()
Harpoon by ThePrimeagen is a Neovim plugin that maintains a small, numbered list of the files you're actively working on.
category:
plugins
tags:
#navigation
#buffers
#marks
#plugins