vimgit-diffvimdiffvim-fugitive

How can I view git diff for any commit using vim-fugitive?


vim-fugitive side-by-side git diff is great for viewing diff of unstaged files.

How can I use vim-fugitive to git diff


Solution

  • Diff between current file and the index

    :Gdiff :0
    

    Diff between current file and some other [revision]

    :Gdiff [revision]
    

    Diff between current file and current file 3 commits ago:

    :Gdiff ~3