Vim run commands from bash script and exit without leaving shell in a bad state

If I do:

echo 'vim +BundleInstall +qall' | bash

it installs my bundles correctly, but leaves the shell in a bad state (ncurses options) because of the pipe.

Is there a way to prevent the shell from being in a bad state?

Same for the minimal test case: echo 'vim +qall' | bash

Similar to: Run vim command from commandline, but the question there was for an interactive shell, so vim +BundleInstall +qall was fine.

I want to do this to be able to automate Vim plugin installation as:

wget -O- http://a.com/bootstrap-scrit.sh | bash

in a bootstrap script that currently contains vim +BundleInstall +qall. This command can be changed if needed.

Vundle issue: https://github.com/gmarik/Vundle.vim/issues/59

Upvotes: 4

Views: 1821

Answers (1)

gniourf_gniourf
gniourf_gniourf

Reputation: 46893

You can source your script instead, like so:

. <(wget -O- http://a.com/bootstrap-scrit.sh)

Upvotes: 2

Related Questions