To read a file into the vim buffer I can do something like:
:r myfile.txt
Or to grab a command's output:
:r !ls
Is there a way to run a vim command and get the output to where my cursor is? something like:
:r nmap
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.
Sign up to join this communityTo read a file into the vim buffer I can do something like:
:r myfile.txt
Or to grab a command's output:
:r !ls
Is there a way to run a vim command and get the output to where my cursor is? something like:
:r nmap
:r|put=execute('nmap')
. How could that be done with:silent
too? – David542 Jun 13 '20 at 7:10:silent put =execute('nmap')
– Matt Jun 13 '20 at 7:12