Running vim-fugitive from the command line

I really like Fugitive (VIM git wrapper plugin). However, I would like to create a script that runs vim and then runs

:Gstatus 

immediately. However when i try

 vim -c Gstatus 

I get an error Gstatus is not an editor command

+4
source share
3 answers

It works

 gvim -c 'Gstatus | wincmd j | hide' . 

makes a full-screen full-window window and hides the directory explorer buffer. Also, when you hide the directory buffer, when you exit the fjutative buffer, vim closes

+2
source

You can do this (if you are in the root directory of the project):

 $ vim -c 'view .git/index' 

It opens the git index in read-only mode (mimics the main command: Gstatus)

+1
source

As a slight improvement in the response to bradgonsurfing

 vim -c 'Gstatus | wincmd o' . 

This works even if you installed splitbelow

0
source

All Articles