How do I indent the current line without changing local marks in Vim?
:lockmarks normal! >>
When you run editing commands from the command line, Vim usually updates special marks like '[ and '] to the changed text.
2125 results for "i' a'"
:lockmarks normal! >>
When you run editing commands from the command line, Vim usually updates special marks like '[ and '] to the changed text.
z<CR> and z. and z-
Vim has two sets of scroll-and-position commands: zt/zz/zb (which reposition the screen but keep the cursor column intact) and z/z.
gn
The gn motion searches forward for the next match of the last search pattern and visually selects it.
search #navigation #search #motions #normal-mode #repeat #editing
f{char} ; ,
The f, F, t, and T motions search for a character on the current line.
g?iw
g? is Vim’s built-in ROT13 operator.
:profile start profile.log | profile func *
When Vim feels sluggish during editing—not just at startup—you need runtime profiling to pinpoint which functions are consuming the most time.
config #profiling #debugging #config #ex-commands #performance
dp and do
When comparing two files side by side in Vim's diff mode (:diffsplit or vim -d file1 file2), you often want to accept or push individual changes between the fil
*cgn
Global substitution is fast, but sometimes you need selective control over each occurrence.
vim-matchup
The vim-matchup plugin by Andy Massimino is a drop-in replacement for Vim's built-in matchit plugin that supercharges the % key to work with language-specific k
plugins #plugins #matchup #navigation #text-objects #matching
:Lazy
lazy.
augroup name | autocmd! | autocmd ... | augroup END
Autocommand groups (augroup) with autocmd! prevent duplicate autocommands from accumulating every time you source your vimrc.
:nnoremap / :inoremap / :vnoremap
Vim has two types of key mappings: recursive (:map, :nmap, :imap) and non-recursive (:noremap, :nnoremap, :inoremap).
:keepjumps normal! gg=G<CR>
Whole-buffer reindent is common, but doing it naively can pollute your jumplist and break navigation flow during review.
<C-f> (in command-line mode)
When you're already on the Vim command line and realize you need complex edits — inserting text from multiple positions, reordering arguments, or referencing
<Leader><Leader>w
The vim-easymotion plugin replaces Vim's default motion commands with a visual overlay system that lets you jump to any visible position on screen in just two o
gg=G
The gg=G command re-indents every line in the current file according to Vim's indentation rules.
:set showmatch
How it works The :set showmatch option makes Vim briefly jump the cursor to the matching opening bracket when you type a closing bracket.
:set listchars=
The listchars option controls exactly which invisible characters Vim highlights when list mode is active.
<C-w>z or :pclose
The preview window shows file contents temporarily without switching your editing context.
buffers-windows #buffers-windows #quickfix #preview #navigation
:let @+=@%
The % register always holds the name of the current file (as a relative path).