Sometimes you need to fetch some data or the results of a shell command and insert it into your current buffer of vim
. You could copy and paste this from one window to another or use tmux
to copy to the clipboard and paste into vim
. Or… You could do it straight from vim
- like so…
|
|
:
– VIM colon command promptread
– insert what comes to the right of the read command into the current buffer!
– execute shell commandls -lah
– directory listing on a *nix OS
And for something spiffy, insert the result of a math calculation!
|
|
:read !echo "like a boss!"