How do I jump back to the previous context line without preserving exact column?
''
When you jump around a file, Vim tracks prior locations.
navigation #navigation #motions #marks #jumplist #normal-mode
870 results for "it at"
''
When you jump around a file, Vim tracks prior locations.
navigation #navigation #motions #marks #jumplist #normal-mode
:let @q = substitute(@q, '\n$', 'A;<Esc>\n', '')
Rerecording a long macro for one tiny change is slow and error-prone.
mzgUiw`z
When you run an operator like gUiw, Vim can leave your cursor in a slightly different place than where you started.
:put =toupper(@")
Registers in Vim are not only for raw replay; you can treat them as string data and transform them at paste time.
registers #registers #expression-register #editing #vimscript
:'<,'>s/^/\=line('.')-line("'<")+1 . '. '/
When you need quick numbered steps, logs, or checklist entries, this pattern adds numbers only to the lines you selected, not the whole buffer.
:%normal @q
To apply a macro to every line in the file, use :%normal @q.
gj and gk
When wrap is enabled, long lines wrap across multiple screen lines.
:reg {names}
The :registers command dumps every register at once, which is noisy when you only care about a handful.
<C-r><C-r>"
In Insert mode, plain {register} inserts register content but may reindent or auto-format depending on context.
registers #registers #insert-mode #editing #indentation #text
:'<,'>s/\%V./\U&/g
When you need to transform text in-place without touching surrounding content, \%V is one of Vim's most precise tools.
:%s/\v^([^,]+),([^,]+),/\2,\1,/<CR>
When CSV-like data has two columns in the wrong order, manually fixing each line is slow and error-prone.
gj
The gj command moves the cursor down by one display line rather than one physical line.
\_.\+
By default, .
:e $MYVIMRC
The :e $MYVIMRC command opens your Vim or Neovim configuration file instantly, no matter where it lives.
/\vstart\_.{-}end
Multiline searches in Vim often overmatch because .
qq;.q then @q or @@
The dot command (.
\c
Vim lets you embed \c or \C directly inside a search pattern to control case sensitivity for that search only, regardless of your 'ignorecase' and 'smartcase' s
\%[seq]
Vim's \%[seq] atom makes the sequence seq optional in a pattern — matching any prefix of the sequence (including nothing).
.
The .
:setlocal winfixheight
Quickfix windows are easy to disturb when you open, close, or rebalance other splits.