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
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 outqall
, what does it mean? Commented Apr 3, 2021 at 1:59 -
1Sorry, 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 -
-
1@job_start Yes you can. You can either do
vim -c 'PlugUpgrade' -c 'PlugUpdate' -c 'qall'
, for example, orvim -c 'PlugUpgrade | PlugUpdate | qall'
. Commented Apr 4, 2021 at 15:19