How do I search backward for the word under the cursor?
#
The # command searches backward for the exact word under the cursor, jumping to the previous occurrence.
287 results for ":jumps"
#
The # command searches backward for the exact word under the cursor, jumping to the previous occurrence.
:set whichwrap+=<,>,h,l
By default, h and l stop at line boundaries.
:set isfname+=@-@
gf is fast until it stops exactly at characters common in modern import paths, especially @ in scoped package names (@org/pkg/file).
:g/^./,/^$/join
The :g/^.
command-line #command-line #editing #global #formatting #paragraphs
:keepjumps {command}
The :keepjumps modifier lets you run any movement or command without recording a new entry in the jump list.
navigation #navigation #ex-commands #jump-list #normal-mode #vimscript
:packadd matchit
The matchit plugin ships with Vim and Neovim but is not enabled by default.
/pattern1/;/pattern2/
Vim's search offsets allow chaining two patterns together with a semicolon.
:next
When Vim is opened with multiple files (e.
command-line #buffers-windows #ex-commands #navigation #editing
:packadd {package}
Vim ships with several useful packages in its opt/ directory that are not loaded by default.
:drop {file}
When the same file is already open elsewhere, using :edit can create extra navigation friction because you stay in the current window and may lose layout contex
buffers-windows #buffers-windows #windows #buffers #workflow
<C-w>t and <C-w>b
When managing multiple splits, t jumps to the top-left window and b jumps to the bottom-right window.
?pattern
The ?pattern command searches backward through the file for the given pattern, starting from the cursor position and wrapping around to the end of the file if n
:vimgrep /pattern/j **/*
By default, :vimgrep jumps your cursor to the first match it finds, which can be disorienting when you just want to collect results and browse them on your own
:set jumpoptions+=stack
By default, Vim's jumplist can feel surprising: if you jump backward and then make a new jump, the old forward path is not always discarded like a browser histo
+ 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
[<C-d>
Vim's [ command jumps to the first definition of the macro or identifier under the cursor, searching from the beginning of the current file and through any file
{count}go
The go command moves the cursor to a specific byte offset from the start of the buffer.
:tag /pattern
When working with ctags, you typically jump to exact tag names with .
[{ and ]}
The [{ motion jumps to the previous unmatched { — the opening brace of the block enclosing your cursor.
o (in visual mode)
While in visual mode, pressing o swaps the cursor to the opposite end of the selection.