How do I trigger wildcard filename completion from inside a custom key mapping in Vim?
:set wildcharm=<C-z>
The wildchar option (default ) triggers wildcard completion interactively on the command line.
2125 results for "i{ a{"
:set wildcharm=<C-z>
The wildchar option (default ) triggers wildcard completion interactively on the command line.
:reg {names}
The :registers command dumps every register at once, which is noisy when you only care about a handful.
{args -> expr}
Vim 8.
has('feature')
The has('feature') function returns 1 if the specified feature is available in the current Vim/Neovim instance, 0 otherwise.
:saveas {newname}
:saveas saves the buffer to a new file and redirects all future :w commands to write to that new filename — making it the true "Save As" command in Vim.
:let @q .= 'j.'
When a recorded macro is almost right but missing one repeated step, re-recording from scratch is usually slower and riskier than patching the register directly
qq{cmds}@qq
A recursive macro is one that calls itself at the end of its own body.
:let view=winsaveview() | {cmd} | call winrestview(view)
When writing Vimscript functions or mappings, commands like :substitute, gg, or :%normal will move the cursor and change the scroll position.
:let @/='\V'.escape(@", '\\')
When you yank text that contains regex characters like .
<C-r><C-r>{reg}
When you insert a register with {reg} in insert mode, Vim processes the content as if you had typed it — this means autoindent, autoformat, and insert-mode ma
g<C-g>
While shows basic file info (filename, line count, position), g provides a much more detailed statistical breakdown of your file or visual selection.
let @q = 'keystrokes'
Macros recorded with q{register} are stored in registers and lost when Vim exits.
gcip
The vim-commentary plugin exposes gc as a comment operator, which means it composes with any Vim motion or text object.
plugins #plugins #editing #commenting #text-objects #normal-mode
reg_recording() and reg_executing()
Vim exposes two built-in functions for querying the current macro state: regrecording() and regexecuting().
:t {address}
How it works The :t command (short for :copy) copies one or more lines and places them below the specified address.
:g/pattern/t$
How it works The :g (global) command combined with :t (copy) lets you duplicate all lines matching a pattern to a specific location.
\@<=
The \@<= operator is Vim's zero-width look-behind assertion.
:set gdefault
By default, :s/old/new/ only replaces the first occurrence of a pattern on each line.
<C-x><C-u>
Vim's invokes a user-defined completion function, letting you plug any completion logic you want into the standard insert-mode completion popup.
:silent keeppatterns %s/\s\+$//e
Trailing whitespace cleanup is a common housekeeping step, but a plain substitution can leave side effects: it can overwrite your last search pattern (@/) and t
command-line #command-line #ex-commands #editing #search #formatting