How do I replace a line (or range) with the output of a shell command in Vim?
:.!{cmd}
:.
211 results for "insert mode"
:.!{cmd}
:.
cgn
The cgn command combines the change operator with the gn motion to change the next occurrence of your last search pattern.
$
The $ command moves the cursor to the last character of the current line.
"0p
Register 0 (the yank register) always contains the text from your most recent yank command — and unlike the unnamed register, it is never overwritten by delet
vi{
The vi{ command visually selects everything inside the nearest pair of curly braces {}, without selecting the braces themselves.
visual-mode #visual-mode #text-objects #editing #normal-mode
:let @q then use in nnoremap
Macros are stored in registers as plain keystroke strings.
^
The ^ command moves the cursor to the first non-blank character of the current line.
<C-r><C-a>
When you are in command-line mode, inserts the word under the cursor (alphanumeric and _ only).
:verbose map <key> or :verbose set option?
The :verbose prefix shows where a mapping, setting, command, or function was defined — which file and line number.
command-line #command-line #debugging #config #mappings #workflow
"qp
Macros are stored as plain text in named registers.
yiw
How it works The command yiw yanks (copies) the inner word under the cursor.
set statusline=%{MyCustomFunc()}
How it works Vim's statusline supports the %{expr} syntax which evaluates a Vimscript expression and displays the result.
:nnoremap <buffer> <leader>r :!python %<CR>
How it works By adding to a mapping command, the mapping only applies to the current buffer.
:let @q = 'commands'
Macros in Vim are just text stored in named registers.
:set pumheight=10
By default, Vim's completion popup menu (the PUM — Pop-Up Menu) can expand to fill the entire screen if there are many candidates.
:'<,'>norm {commands}
The :normal (or :norm) command lets you execute normal mode keystrokes from the command line.
command-line #editing #ex-commands #normal-mode #productivity #ranges
qa{edits}@bq
How it works Vim macros can call other macros, creating a modular system of reusable building blocks.
"Ayy
The "Ayy command appends the current line to register a instead of overwriting it.
:!command
The :!command syntax lets you execute any shell command directly from within Vim without leaving the editor.
di(
The di( command deletes everything inside the nearest pair of parentheses without removing the parentheses themselves.