I do some automatic setup in my vimrc that calls git clone, before any other plugins (such as dispatch.vim) are installed. It's called after some other messages are displayed using echom
, and I'd like to to execute without clearing the screen at all. I've been messing around with redir
, shellredir
and shortmess
, but nothing has worked so far:
" some other messages are displayed and in the buffer ...
" install neobundle
if $HAS_GIT == 1
" display the inline message notifying user neobundle is being installed,
" I want this to displayed inline with the other messages
echom 'installing neobundle ...'
" trying to use shellredir to temporarily disable external command
" from displaying any output and causing the screen refresh - doesn't work
let shellredir_restore = &shellredir
let &shellredir = '>/dev/null'
" trying to use redir to temporarily disable external command
" from displaying any output and causing the screen refresh - doesn't work
redir >> /dev/null
" silently execute git clone as a synchronous task - desired behavior.
silent execute '!git clone ' g:neobundle_url . ' ' . g:neobundle_dir . '&>/dev/null'
" once this command completes, the screen is cleared and additional
" 'inline' messages (that should be displayed) are, but with the
" previous messages removed. all output after this point is written at
" the *bottom* of the buffer.
" end vim output redirection
redir END
" check if git clone completely successfully
if v:shell_error == 0
let s:neobundle_installed = 1
else
let s:neobundle_installed = 0
endif
" restore shellredir to original value
let &shellredir = shellredir_restore
endif
So to clarify:
- i want to suppress all output from git clone
- i want to prevent the refresh by the git clone, which clears previous messages
- i want additional messages after the git clone to be drawn 'inline' as normal, not at the bottom of the screen
Any suggestions?