I really like Fugitive (VIM git wrapper plugin) However I would like to create a script that starts vim and then runs
:Gstatus
immediately. However when I try
vim -c Gstatus
I get an error stating that Gstatus is not an editor command
I really like Fugitive (VIM git wrapper plugin) However I would like to create a script that starts vim and then runs
:Gstatus
immediately. However when I try
vim -c Gstatus
I get an error stating that Gstatus is not an editor command
vim +Gstatus +only
works. I have it aliased to vimg
+Gstatus
is now deprecated in favor of +Git
–
Discomfiture +Gstatus
is deprecated. Instead do vim +Git +only
–
Annice This works
gvim -c 'Gstatus | wincmd j | hide' .
makes the fugative window full size and hide the directory explorer buffer. Also with the directory buffer hidden when you quit the fugative buffer vim closes
vim -c Gstatus .
since gives me a window to see diffs (pressing D
on the cursor line) without closing the status window. –
Affectionate .
directory trick doesn't work when NERDTree plugin is enabled, but .
can be replaced by any other filename that doesn't exist. –
Affectionate .
did NOT work for me as the file argument to Vim, so as Ricardo suggested, all I did was use temp
as the file name. (Vim only creates the swap file for temp
). –
Neuro You can do this (assuming you are in the project root dir):
$ vim -c 'view .git/index'
It opens the git index in read-only mode (mimicking the essentials of the :Gstatus command)
:Gstatus
but it works for committing. –
Atlantis As a slight improvement on bradgonesurfing's answer
vim -c 'Gstatus | wincmd o' .
This works even if you have splitbelow
set
Run vim +Git +only
I got here thanks to @jsm3031's answer, which nudged me in the right direction.
© 2022 - 2024 — McMap. All rights reserved.
:GStatus
right after you started Vim without any file? – Backache