1

I'm using MacOSX, and I have script on Terminal, and since I will probably forget how to update everything inside Vim/NeoVim, is it possible to pass command, e.g. :PlugUpdate, to nvim/vim so that I can update all things (Terminal Homebrew, Vim-Plug, etc) at once?

1 Answer 1

2

You can pass a command when starting up with -c (or +):

vim -c 'PlugUpdate'

You may also want to pass qall if you are running this from a script.

4
  • I searched vim -h and found -c, but I didn't find out qall, what does it mean? Commented Apr 3, 2021 at 1:59
  • 1
    Sorry, perhaps I wasn’t clear. I meant also passing -c 'qall' i.e. the ex command :qall to quit all vim windows afterwards (otherwise your script will open but not close vim). Commented Apr 3, 2021 at 3:01
  • Can I pass multiple command than just PlugUpdate? Commented Apr 4, 2021 at 0:01
  • 1
    @job_start Yes you can. You can either do vim -c 'PlugUpgrade' -c 'PlugUpdate' -c 'qall', for example, or vim -c 'PlugUpgrade | PlugUpdate | qall'. Commented Apr 4, 2021 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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