How do I jump back to where I was before my last search?
``
The double backtick jumps to the exact position before the last jump.
1024 results for "i" a""
``
The double backtick jumps to the exact position before the last jump.
:s/,/\r/g
In Vim's substitute command, use \r (not \n) in the replacement to insert a real newline.
:m {line-number}
The :m (move) command moves the current line to after the specified line number.
:terminal ++curwin
By default, :terminal opens a new split window for the terminal emulator.
buffers-windows #terminal #buffers #windows #shell #ex-commands
:cdo s/old/new/g | update
The :cdo command executes a given command on every entry in the quickfix list.
command-line #command-line #quickfix #batch-editing #search #multi-file
<C-r><C-r>a
In insert mode, a pastes register a but processes the text as if typed, which can trigger abbreviations and mappings.
:g/pattern/y A
The :g/pattern/y A command yanks every line matching the pattern and appends it to register a.
command-line #command-line #registers #global #ex-commands #filtering
:let @q =
Instead of recording a macro with q, you can assign any string directly to a named register using :let @{register} = 'keys'.
:let @+ = @"
Vim's :let @{reg} syntax lets you read from one register and write to another.
<C-f> from : prompt
Pressing while on the : command line opens the command-line window, where you can edit your command using full Vim editing capabilities.
<C-q> (Telescope)
While inside any Telescope picker, pressing sends all current results to the quickfix list and closes the picker.
:g/pattern/cmd1 | cmd2
The :g (global) command can execute multiple Ex commands per matching line by chaining them with .
command-line #command-line #global #ex-commands #batch-editing #advanced
"+y and "+p
The "+ register is linked to the system clipboard.
:%s/,/\r/g
In Vim's substitute command, \r in the replacement string inserts a newline.
:put =map(getreg('a', 1, 1), 'toupper(v:val)')
By using getreg() with the list flag and applying map(), you can transform register contents with any Vimscript function before pasting.
:call setreg('"', @", 'l')
Vim registers carry not just their text content but also a type: charwise (c), linewise (l), or blockwise (b).
gcc (toggle line), gc{motion} (toggle range)
vim-commentary by Tim Pope provides a simple way to toggle comments.
:let g:debug_macro=1 | normal @a
When a macro doesn't work as expected, debugging it step by step is essential.
Harpoon: mark files and jump with <leader>1-4
Harpoon by ThePrimeagen provides instant access to a curated list of files you're actively working on.
<C-a> / <C-x>
Pressing increments and decrements the number under or after the cursor.