How do I jump forward and backward through all marks in the current buffer?
]' and ['
The ]' and [' motions let you traverse every lowercase mark set in the current buffer without needing to remember which registers you used.
]' and ['
The ]' and [' motions let you traverse every lowercase mark set in the current buffer without needing to remember which registers you used.
gq{motion}
The gq{motion} operator reformats text to fit within Vim's textwidth setting, inserting hard line breaks where lines are too long.
g$
The g$ command moves the cursor to the last character of the current screen line, not the end of the logical line.
+ and -
The + and - motions jump to the first non-blank character of the next or previous line respectively — combining vertical movement and ^ into a single, count-a
]# and [#
Vim provides the ]# and [# motions specifically for navigating C preprocessor conditionals.
ea
The ea compound shortcut moves to the last character of the current word with e, then enters insert mode after the cursor with a.
{count}H and {count}L
Most Vim users know H jumps to the first visible line, M to the middle, and L to the last.
[e and ]e
The [e and ]e mappings from Tim Pope's vim-unimpaired plugin exchange the current line (or a visual selection of lines) with the line above or below.
50%
Prefixing the % command with a count jumps the cursor to that percentage through the file.
:set nostartofline
By default, many Vim movement commands — gg, G, Ctrl-d, Ctrl-u, Ctrl-f, Ctrl-b, and others — snap the cursor to the first non-blank character of the destina
{count}J
The J command joins the current line with the line below, adding a space between them.
:lua require('flash').jump()
flash.
zH and zL
zH and zL scroll the viewport horizontally by half a screen width, letting you navigate wide content efficiently when wrap is disabled.
navigation #navigation #scrolling #horizontal #nowrap #motions
[/
When editing code, you often need to navigate to the boundaries of multi-line block comments (/ .
z<CR>
While zt scrolls the current line to the top of the screen, z does the same scroll but also moves the cursor to the first non-blank character of that line.
nnoremap <expr> j v:count == 0 ? 'gj' : 'j'
By default, j and k move by physical lines (newline-delimited), which jumps over the entire visual span of a long wrapped line in a single keystroke.
gw{motion}
The gw operator reformats text just like gq, but leaves the cursor exactly where it started.
{count}go
The go command moves the cursor to a specific byte offset from the start of the buffer.
[z and ]z
The [z and ]z commands jump the cursor to the start and end of the innermost open fold containing the cursor.
das
Vim defines a sentence as text ending with .
editing #editing #text-objects #delete #normal-mode #motions