Inject the output of a shell command into the current text in Vim
August 20th, 2014
Today I’ve discovered a really nice feature in vim
. Sometimes it is nice to inject the output of a shell command into the current text, like the current date and time.
You can use the :read
command for that. Like this:
:read !date
Afar from date
there are a plenty of use cases I can imagine of, like ls
, tree
, diff
, cat
(!).
Thanks to Vim
!
Februar 2nd, 2015 at 17:37
it works with any command
:read !anycommand
and if you want you can also try
:!anycommand to call a shell comm while on vim
pretty cool yeah 😀