--- layout: note ---

This is a macro that's been very helpful for me while writing short scripts in Vim. It adds and comments out the output of your script (or any command) to the end of the current file.

G o<Esc> ma:r!./filename.sh<Enter> $ v 'a:norm 0i## <Enter>
qt 'ajdG :r!./filename.sh<Enter> $ v 'a:norm 0i## <Enter> 'acc## Test output:<Enter> 'aq

@t