How do I jump to a literal search target without adding jump-list noise?
Answer
:keepjumps normal! /\Vtarget\<CR>
Explanation
Repeated navigational searches can pollute the jump list, especially when you are doing targeted inspections before returning to your main edit location. Pairing :keepjumps with a normal-mode search lets you move the cursor to a match without recording a new jump entry. Adding \V makes the pattern literal, so punctuation-heavy tokens are matched exactly.
How it works
:keepjumpssuppresses jump-list updates caused by the following commandnormal!executes raw normal-mode keys (ignoring user mappings)/starts a forward search\Vswitches to very-nomagic mode so most characters are treated literallytargetis the exact text to find<CR>executes the search
Example
Use this when scanning for an exact token, then returning with <C-o> to your prior meaningful jump history:
:keepjumps normal! /\Vtarget\<CR>
Before: jump list points to your true edit checkpoints
After: cursor moves to "target" but no extra jump entry is added
Tips
- Replace
targetwith escaped text generated from your tooling when searching symbols that contain regex metacharacters. - Use
?instead of/insidenormal!for backward literal jumps with the same no-noise jump behavior. - Combine with
keeppatternsif you also want to preserve your previous/pattern.