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?


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.

  • I searched vim -h and found -c, but I didn't find out qall, what does it mean? – job_start Apr 3 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). – Andrew Ho-Lee Apr 3 at 3:01
  • Can I pass multiple command than just PlugUpdate? – job_start Apr 4 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'. – Andrew Ho-Lee Apr 4 at 15:19

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.