Add function to print a command output to the buffer

This commit is contained in:
Rane Brown 2019-12-21 09:10:39 -07:00
parent 7ad0ad36dc
commit f18bb6bc57
1 changed files with 13 additions and 1 deletions

View File

@ -67,8 +67,20 @@ Before (Define functions):
" Write current file: helper to hide `set bt=`
function! WriteMe()
set bt=
set buftype=
write %
endfunction
" print a command output to the buffer
function! PrintCommand(cmd)
redir => message
silent execute a:cmd
redir END
if empty(message)
Log 'no output'
else
silent put=message
endif
endfunction
# vim: ft=vim