How do I search a project without overwriting the global quickfix list?
:lvimgrep /pattern/gj **/*.js | lopen
When you already rely on the global quickfix list for compiler errors or another search, running :vimgrep can wipe that context.
:lvimgrep /pattern/gj **/*.js | lopen
When you already rely on the global quickfix list for compiler errors or another search, running :vimgrep can wipe that context.
:ptjump /{pattern}
When a symbol name is ambiguous, jumping directly with :tag can bounce you around the codebase and disrupt your working context.
navigation #navigation #tags #windows #code-navigation #command-line
<C-w>TgT
When a split temporarily becomes the center of attention, promoting it to its own tab can reduce layout noise.
d/END/e<CR>
When you need to remove text up to a known marker, a plain search motion is often almost right but stops at the start of the match.
gvV
gv is well known for reselecting the previous visual area, but pairing it with V is a practical upgrade when your next action needs linewise semantics.
/TODO/e
Most users know /pattern, but fewer use search offsets to control where the cursor lands after the match.
:wincmd r
When a split layout is correct but the window positions are awkward, you do not need to close and reopen anything.
5<C-o>
Most Vim users know jumps backward in the jumplist, but fewer use a count with it.
<C-o>zvzz
Jumping backward with is fast, but in folded or dense files it can land you in a collapsed section or near the edge of the screen, forcing extra cleanup keystro
:lockmarks keepjumps keeppatterns %s/foo/bar/ge
Large substitutions are efficient, but they often leave side effects: your last search changes, your jumplist gets noisy, and marks can shift in ways that break
command-line #command-line #editing #substitution #navigation
:keepjumps normal! /\Vtarget\<CR>
Repeated navigational searches can pollute the jump list, especially when you are doing targeted inspections before returning to your main edit location.
navigation #navigation #search #jumplist #normal-mode #workflow
:set switchbuf=usetab,newtab
When you jump to buffers from quickfix, tags, or command-line completions, Vim's default window selection can feel unpredictable.
buffers-windows #buffers #windows #tabs #quickfix #navigation
g;zvzz
Jumping through the changelist with g; is useful, but in real files the destination can land inside a closed fold or off-center on screen, which slows review.
/\%>10l\%<20lTODO
Vim regex supports position atoms that can constrain where a match is allowed to occur.
:keepmarks {command}
Many batch edits in Vim update special marks like '[ and '], which can disrupt follow-up motions or tooling that depends on those positions.
navigation #navigation #marks #command-line #refactoring #editing
,
After using f, t, F, or T for single-character motion on a line, Vim lets you repeat that character search without retyping the target.
:set wrapscan!
wrapscan controls what happens when a / or ? search reaches the end (or beginning) of the file.
]`
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.
:keepjumps normal! 500@q
Running a macro hundreds of times is efficient, but it can flood your jumplist and make normal navigation painful afterward.
/\%>80v\S
When you enforce line-length limits, visual guides show where the boundary is, but they do not help you jump directly to violations.