How do I define a custom user command in Neovim Lua config that accepts arguments and has a description?
vim.api.nvim_create_user_command()
Neovim's Lua API provides vim.
2125 results for "i( a("
vim.api.nvim_create_user_command()
Neovim's Lua API provides vim.
:'<,'>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.
vim.system()
vim.
<C-w>^
Vim tracks the alternate buffer — the last file you were editing before the current one.
\%^ and \%$
Vim's ^ and $ anchors match the start and end of a line, but sometimes you need to match the very beginning or very end of the entire buffer.
<C-r>=substitute(getreg('+'), '\n\+', ', ', 'g')<CR>
When you paste from the system clipboard into code or config, multiline text often needs to be flattened first.
registers #registers #insert-mode #expression-register #text-processing
:set virtualedit=block
By default, Vim's visual block mode () is limited by line length — if some lines are shorter than others, the block selection gets ragged.
p (in visual mode)
In visual mode, pressing p replaces the selected text with the contents of the default register.
:set nrformats-=octal
Vim's and increment and decrement numbers under the cursor.
<C-v>jj"ay then "ap
How it works Vim registers remember not just the text content but also the type of selection that was used to yank it: characterwise, linewise, or blockwise.
shellescape({expr})
The shellescape() function wraps a string in shell-safe quoting, escaping any special characters so it can be embedded in a shell command constructed with :exec
command-line #ex-commands #command-line #editing #normal-mode
:cdo keepjumps keeppatterns %s/\<OldSymbol\>/NewSymbol/ge | update
When you run :cdo over a large quickfix list, Vim can leave your jump list noisy and your last search pattern overwritten.
command-line #quickfix #ex-commands #search #editing #refactoring
nnoremap <expr> j (v:count == 0 ? 'gj' : 'j')
The map modifier turns a mapping's right-hand side into a Vimscript expression that is evaluated at the time the key is pressed, with its return value used as t
<C-w>f
How it works You may already know that gf opens the file path under the cursor in the current window.
:g/pattern/+1d
Using :g/pattern/+1d you can delete the line that comes right after each line matching a pattern, in one pass.
\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
:%!xxd
Vim can serve as a hex editor by piping buffer contents through xxd, a hex dump utility that ships with Vim.
:b N
How it works Every buffer in Vim is assigned a unique number when it is opened.
/\Vsrc/main.c\m:\d\+<CR>
Sometimes you need one search pattern that treats a literal path strictly while still using regex power for the suffix.
"ayy ... "ap
Named registers let you store multiple pieces of text independently.