1

When using vim-fugitive if you issue :Gstatus it splits the screen and gives you the would be git commit editor and you can move over different files that have changes and press enter to see them in the other half of the screen. I believe it is like issuing :Gedit .

I then need to issue a :Gdiff manually to split the editor in half and see the side by side diff of the file to review and or stage it.

My question is is there a way to make it automatically go to :Gdiff when I press enter, while my cursor is on a file name that has changes.

Basically trying to save some time when going through a large list of files.

Ali
  • 18,665
  • 21
  • 103
  • 138
  • 1
    Have you tried `dd` or `D` in the `:Gstatus` window? – Peter Rincker Apr 13 '17 at 17:19
  • This is the correct answer, where did you find it, did I miss it in :h ? Is there a difference between `dd` and `D`? by the way that is a odd choice? Just checked and it is in the help file `D` is. @PeterRincker Would you please make it an answer rather than a comment – Ali Apr 13 '17 at 17:30

1 Answers1

3

You can use D or dd inside the :Gstatus window to run :Gdiff on the file under the cursor. See :h :fugitive-:Gstatus or use g? inside the :Gstatus window.

For additional help you may wan to look at Vimcasts, which has some very nice fugitive.vim series.

Peter Rincker
  • 43,539
  • 9
  • 74
  • 101