How do I combine multiple Ex commands into a single undo step in Vim?
:undojoin
When writing Vim scripts or running multiple Ex commands, each command normally creates a separate undo entry.
189 results for ""+y"
:undojoin
When writing Vim scripts or running multiple Ex commands, each command normally creates a separate undo entry.
:let @a = system('cmd')
You can populate any Vim register with the output of an external shell command using :let @{register} = system('{command}').
{ and }
The { and } commands move the cursor by paragraph — jumping to the previous or next blank line.
gU{motion} / gu{motion} / g~{motion}
Vim has three case operators that work with any motion or text object: gU for uppercase, gu for lowercase, and g~ for toggle case.
editing #editing #case #operators #text-objects #normal-mode
iabbrev
:iabbrev defines insert-mode abbreviations that expand automatically when you type a non-keyword character (space, punctuation, ) after the abbreviation.
V%
Pressing V% enters visual line mode on the current line and immediately extends the selection to the line containing the matching bracket or brace.
cs"(
The cs operator in vim-surround (change surrounding) swaps one pair of delimiters for another without touching the content inside.
<C-r>= (command-line mode)
Just like = lets you insert evaluated expressions in insert mode, you can use it inside an Ex command on the command line to embed any Vimscript expression resu
gv
The gv command reselects the exact same area that was last selected in visual mode.
:put ={expression}
The :put command inserts the contents of a register as a new line below the cursor.
:/start/,/end/d
Instead of specifying line numbers for Ex command ranges, you can use search patterns.
command-line #ex-commands #editing #search #ranges #command-line
V]}
Pressing V]} in normal mode enters visual line mode and immediately extends the selection to the next unmatched closing brace }.
visual-mode #visual-mode #navigation #text-objects #editing #motions
<C-r>=system("date")<CR>
The expression register (=) is one of Vim's most powerful yet underused features.
set smoothscroll
By default, Neovim's half-page scroll commands (, , , ) count movement by text lines, not screen rows.
vim.lsp.completion.enable()
Neovim 0.
:.+1,.+3d
Vim's Ex command addresses support arithmetic offsets relative to the current line (.
command-line #ex-commands #editing #navigation #command-line
'[ and ']
Vim automatically sets two special marks after every change, yank, or put operation: '[ and '].
gl{motion}{char}
vim-lion (by Tom McDonald) adds gl and gL as alignment operators.
<C-v> (in visual mode)
Once you are in any visual mode, pressing v, V, or switches to charwise, linewise, or blockwise visual mode respectively — without cancelling the current sele
!{motion}{cmd}
The ! operator in normal mode lets you pipe any motion's text through a shell command and replace it with the output.
editing #editing #shell #external-command #normal-mode #filtering