Linux – How to run Vim command from the shell

linuxmakeshellvim

This might be a dumb question, but bear with me.

I'm automating some of the usual stuff I do when setting up a new work environment, and would like to automate the Vim command :BundleInstall (for installing all my Vim plugins).

Is it possible to run this from the shell?

Alternatively, is it possible to have the script run Vim, execute :BundleInstall, wait until it finishes and quit?

Thanks.

Best Answer

From the vim(1) man page:

+{command}

-c {command}

{command} will be executed after the first file has been read. {command} is interpreted as an Ex command. If the {command} contains spaces it must be enclosed in double quotes (this depends on the shell that is used). Example: Vim "+set si" main.c

Note: You can use up to 10 "+" or "-c" commands.