How do I display available keybindings in a popup when pressing leader?
:WhichKey
which-key.
2277 results for "@a"
:WhichKey
which-key.
:execute "command"
The :execute command evaluates a string expression and runs it as an Ex command.
"/
Vim stores the last search pattern in the special / register.
/pattern1\_.{-}pattern2
Vim's regex engine normally treats .
:put =strtrans(@q)<CR>
Macro failures are often caused by hidden control keys like , , or tabs that are hard to see in raw register output.
set wildcharm=<Tab>
By default, pressing in a : mapping inserts a literal tab character rather than triggering wildmenu completion.
:set switchbuf=useopen,usetab
By default, Vim opens a new window (or reloads the buffer in the current window) whenever you navigate to a quickfix entry, tag, or :buffer command — even if
:helpgrep {pattern}
:helpgrep searches the full text of every Vim help file for a pattern and loads all matches into the quickfix list.
ciw
The ciw command deletes the inner word under the cursor and drops you into insert mode so you can type a replacement.
:let g:netrw_liststyle = 3
By default, netrw shows files in a flat listing.
plugins #netrw #file-browser #plugins #configuration #built-in
:g/./norm @q
Combining the :global command with :normal lets you run a macro on every non-blank line in one shot.
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.
:s/pattern/~/
In a Vim substitution, using ~ as the replacement string repeats the replacement text from the most recent :s command.
qabi"<Esc>ea"<Esc>wq
How it works This macro wraps the current word in double quotes and moves to the next word, making it easy to repeat across a line or file.
:call setreg('q', keys, 'c')
The setreg() function writes any string directly into a named register, letting you construct macro keystrokes from Vimscript expressions rather than live recor
:setlocal nomodifiable
While :set readonly prevents accidental writes, nomodifiable goes further by preventing any changes to the buffer contents entirely.
buffers-windows #buffers-windows #readonly #modifiable #protection
[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.
:cdo normal! @q
When a refactor target spans many files but only specific matches matter, running a macro globally is risky.
Create plugin/myplugin.vim
A basic Vim plugin is just a .
cr
The vim-abolish plugin (by tpope) provides a cr (coerce) operator that converts the word under the cursor between naming conventions with a single keystroke pai