Run command on shell and get output in vim

bashshellvim

I know how to run shell commands within vim using :!r and :!, but is there a way I can do that from outside, i.e. from bash?

Something along the lines of vim 'ls -al'. The output of ls should be in vim and editable.

Best Answer

You can read stdin

$ ls -al | vim -
Related Question