DEV Community

Discussion on: Execute command line commands from inside vim

Collapse
 
danielkun profile image
Daniel Albuschat

With :.! you can insert the result of the command into the current buffer (the file you are currently editing).

Collapse
 
iggredible profile image
Igor Irianto • Edited

I just tried it - this is awesome! Does :.!{cmd} work exactly the same as :r !{cmd} then? If not, what's the difference?

Collapse
 
danielkun profile image
Daniel Albuschat • Edited

Actually I didn't know about :r !{cmd}, so I'm not sure. From a quick test I noticed that :r inserts a newline above the content, while :.! does not. Other than that, dunno ¯\(ツ)/¯.

Thread Thread
 
iggredible profile image
Igor Irianto

Oh, that's an interesting behavior :) Even a newline makes a difference 😎