Add function to print a command output to the buffer
This commit is contained in:
parent
7ad0ad36dc
commit
f18bb6bc57
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user