There are lots of SO questions on running shell programs from vim. What I'm wondering is if it is possible to do the reverse - i.e.
$ vim :BundleInstall
for example, to allow me to run BundleInstall as part of a script, rather than having to open Vim and run it manually on first running? Is this possible?
I think that this is what you need:
You should check vim man page:
or:
It really depends on what you want to do. Also, as described at the vundle readme file, if you launch vim like this:
This will install all bundle options without opening vim. And just for clarification, from the vim documentation:
Hope it helps!
Does
do what you want?
I'll add another answer for people who are looking for a more general solution.
vim +command
works to run one Vim command but to run several Vim commands from a shell. Instead, start Vim in Ex-mode and supply commands with a Here document. This is an example from a script I wrote. It searches for a pattern in the file and inserts some text before it.Note, now the syntax has changed, and the line should read (As per @sheharyar):
For posterity, previously, the correct line was:
Should anyone other than me be looking! Note: this is in the Github README for vundle.
How about something more complex?
Not sure whether that is totally correct, but it works for me. Thanks @jvc26