How do you insert shell command output into the current buffer?
:r !date
Use :r !command to read the output of a shell command into the buffer below the cursor.
:r !date
Use :r !command to read the output of a shell command into the buffer below the cursor.
:10,15m 25
Use :m (move) with a range and destination.
:%normal A;
Use :%normal followed by normal mode keystrokes.
:marks
Use :marks to display all current marks with their line numbers, column positions, and file/text.
:10,15t 25
Use :t (copy) with a range and destination.
<C-f> on command line
While typing a command, press to open the command-line editing window.
:args *.py
Use :args *.
:argdo %s/old/new/ge | update
Use :argdo to execute a command in every file in the argument list.
S) with vim-surround
With the vim-surround plugin, select text visually and press S) to wrap with parentheses.
v$
Press v to enter character-wise visual mode, then $ to extend selection to the end of the line (excluding the newline).
vit
Press vit to select the inner content of the nearest HTML/XML tag.
:'<,'>!nl -ba
Select lines visually, then run :'!nl -ba to pipe through the nl command which prepends line numbers to each selected line.
o in visual mode
While in visual mode, press o to move the cursor to the opposite end of the selection.
:'<,'>!sort -u
Select lines, then type ! which auto-expands to :'!.
gq in visual mode
Select text with v or V, then press gq to format the selection according to textwidth.
<C-v>jjr*
Enter visual block with , select a column with j, press r followed by the replacement character.
c in visual mode
Select text visually, then press c to delete the selection and enter insert mode.
d in visual mode
Select text visually and press d to delete the selection.
<C-v>jjA text <Esc>
Enter visual block with , select lines with j, press A to append after the block.
<C-v>jjI text <Esc>
Enter visual block with , select lines with j, press I to insert before the block.