I have a installation script that I use to initalize my vim plugins when I'm on a new machine


# Clone vundle into the directory if it's not already
if [[ ! -e bundle/vundle/.git ]]
    mkdir -p bundle
    rm -rf bundle/vundle
    git clone https://github.com/gmarik/vundle.git bundle/vundle

vim +BundleInstall +qall

However, this brings up vim. I was curious if there was a way to have vim hide its interface but still execute the BundleInstall script?

In other words the script would hang until the BundleInstall command finished.


Turns out this was actually embarrassingly simple, not sure why I didn't try this in the first place.

vim +BundleInstall +qall 2&> /dev/null

Vim is an interactive editor; the best you can try is silent batch mode:

vim -es <<<BundleInstall

See :help -s-ex for details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.