Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

vim-fugitive

Diff of current and previous version using vim-fugitive

January 6, 2024 by Tarik

This is what I use: :Gdiff [revision] See :help Gdiff for other options as well (vertical vs horizontal splits, etc). For example: :Gdiff HEAD or if you have a revision number (ie: aaffdfdstsdgssetds): :Gdiff aaffdfds

Categories vim Tags vim, vim-fugitive Leave a comment

How can I run `git diff –staged` with Fugitive?

December 10, 2023 by Tarik

I’ve found a way to do this. Run :Git, you should get a window with contents like the following: # Head: master # Merge: origin/master # Help: g? # # Staged (1) # M example.txt # Scroll down to the staged file, example.txt, and press dd. This will open a diff view, comparing what’s in … Read more

Categories vim-fugitive Tags vim-fugitive Leave a comment

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

April 11, 2023 by Tarik

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

Categories vim Tags git-diff, vim, vim-fugitive, vimdiff Leave a comment

How do you exit vimdiff mode in vim, specifically, for Fugitive?

March 2, 2023 by Tarik

You can execute windo set nodiff noscrollbind and then close the second window. Update: there is a diffoff command. Use windo diffoff, not what I wrote in previous line.

Categories vim Tags vim, vim-fugitive, vimdiff Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa