How do I toggle whether / and ? searches wrap around the file?
:set wrapscan!
wrapscan controls what happens when a / or ? search reaches the end (or beginning) of the file.
287 results for ":jumps"
:set wrapscan!
wrapscan controls what happens when a / or ? search reaches the end (or beginning) of the file.
:keepjumps normal! gg=G
Bulk formatting commands are common in cleanup sessions, but they often leave side effects in your navigation history.
:set nrformats-=octal<CR>
By default, Vim may treat numbers with leading zeros as octal when you use and for increment/decrement.
:set iskeyword+=-
By default, Vim treats hyphens, dots, and many punctuation characters as word boundaries.
<C-w>TgT
When a split temporarily becomes the center of attention, promoting it to its own tab can reduce layout noise.
I
The I (uppercase) command moves the cursor to the first non-blank character of the current line and enters insert mode.
5g;
Most users know g; moves backward through the changelist, but fewer people use a count with it.
qa/pattern<CR>dd@aq
By starting a macro with a search command, the macro becomes conditional — it jumps to the next match before acting, and terminates when no more matches are f
:let @a = execute('messages')
The execute() function (added in Vim 8.
:pedit +/TODO %
When you need a second read-only view of the same file, opening more normal splits can disrupt your working layout.
/foo\|bar
How it works The \ operator in Vim's search pattern works like a logical OR, letting you match any one of several alternatives.
A
The A command moves the cursor to the end of the current line and enters insert mode.
:botright copen 8 | wincmd p
Quickfix is powerful, but opening it can disrupt window layout and yank focus away from your current editing context.
: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
: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
gM
The gM command moves the cursor to the horizontal middle of the current line, regardless of how long the line is.
:delmarks!
Marks accumulate as you work — ma, mb, mc and so on record positions for later jumps.
:keepalt edit path/to/file\<CR>
Experienced Vim workflows often depend on the alternate file (#) for fast toggling with , quick diffs, or two-file review loops.
//
In Vim, pressing // (two forward slashes) in Normal mode repeats the last search pattern.
:keeppatterns %s/old/new/g
The :keeppatterns modifier runs any Ex command without modifying Vim's last search pattern (stored in @/).
command-line #search #ex-commands #command-line #substitute #registers