Questions tagged [vim-fugitive]

Git integration for the Vim editor

A wrapper for Git that injects its functionality inside Vim, such as

  • View any blob, tree, commit, or tag in the repository
  • Bring up the output of git status
  • interactive vertical blame split
  • git mv on a file and simultaneously renames the buffer
  • grep exposure to search the work tree (or any arbitrary commit)
  • statusline integration
  • open the current file on GitHub

More at the github repository.

92 questions
69
votes
15 answers

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

I am using vim with the fugitive extension. It has a :Gdiff command which brings you into vimdiff mode, but what is the right/quick way to close/quit vimdiff mode? I.e., let's say I am editing the file FooBar.txt under Git repository. I fire up…
wik
  • 2,462
  • 1
  • 24
  • 29
56
votes
4 answers

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 staged files? any git revision?
Sathish
  • 20,660
  • 24
  • 63
  • 71
32
votes
8 answers

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

The command :Gdiff is equivalent to running git diff on that file. What's the equivalent for git diff --staged or git diff --cached?
Flimm
  • 136,138
  • 45
  • 251
  • 267
29
votes
10 answers

Diff of current and previous version using vim-fugitive

I know that :Glog will populate the quickfix list with all the versions of the file in the current buffer and that I can hit on these to see the file at that particular version, but is there an easy way to see the diff of a particular…
zoran119
  • 10,657
  • 12
  • 46
  • 88
25
votes
3 answers

Vim:Fugitive:Glog - How to get commits for current file rather than revisions

Currently, if I type :Glog I get the list of revisions for the current file. If I type :Glog -- I get the list of commits for all files. What do I need to type to get the of commits for the current file?
Kyle Heironimus
  • 7,741
  • 7
  • 39
  • 51
24
votes
2 answers

How can I commit files currently displayed in Vim with fugitive?

I am editing files opened split into three windows. I want to commit those into the repository. Is there any commands to do that?
katatagan
  • 343
  • 1
  • 2
  • 6
17
votes
2 answers

Jumping between changed lines in VIM with fugitive

I have a huge file where I modified several lines, and saved it. The fugitive knows which lines are modified, and it would be very useful to just jump between them. Is there an existing hotkey for that, or can I map it somehow?
Max Yankov
  • 12,551
  • 12
  • 67
  • 135
14
votes
3 answers

Getting 'git grep' to work effectively in vim

Fugitive.vim allows me to run git grep commands; unfortunately, the results are not stored in a quickfix-list, so I need to run :cw after a :Ggrep in order to have an easily parseable result list. I would like to type :Ggr "def my_function" instead…
Régis B.
  • 10,092
  • 6
  • 54
  • 90
11
votes
1 answer

Vim fugitive back from :Glog

I'm look for vim command which will exit from Glog'ed file view back to the normal (original) file. EXAMPLE: Let say I'm viewing a file with vim. After entering :Glog I'm able to browse through all git versions of this file. I'm looking for command…
jmarceli
  • 19,102
  • 6
  • 69
  • 67
11
votes
4 answers

Error using the :GDiff command of fugitive.vim using gvim for windows and msys git 1.7.0.2

I've been using git along with fugitive.vim to manage code when I'm on windows. However, I've run into a problem. According to the documentation, the :GDiff command should a diff window and allow me to stage only parts of a file. However, when I…
Paul Wicks
  • 62,960
  • 55
  • 119
  • 146
11
votes
3 answers

git blame of particular lines inside all files filtered with grep command

I know how to run gblame inside a file. I know how to grep a content inside all files in a directory. I'd like to see gblame of particular lines around that one that contains a content. Example: $ blame -R "content" ./ I see a list of files. I want…
sensorario
  • 20,262
  • 30
  • 97
  • 159
11
votes
1 answer

Vim Fugitive: Gblame reblame options

I've been using Fugitive's Gblame recently but don't quite understand what "reblame" does. Can someone describe a little more clearly what these options do: - reblame at commit ~ reblame at [count]th first grandparent P reblame at…
Jonathan.Brink
  • 23,757
  • 20
  • 73
  • 115
11
votes
2 answers

How can I diff two branches with fugitive?

In fugitive I can get the git status in a new window by :Gstatus and in that window to D on a file to get the diff in a new split. It is also possible to get all versions of a file using :Glog and I can load all previous commits with :Glog --. What…
tidbeck
  • 2,363
  • 24
  • 35
9
votes
2 answers

How to do git add . with fugitive?

How do you do git add . in Fugitive for vim? THe command :Git add . is not doing adding anything
Hommer Smith
  • 26,772
  • 56
  • 167
  • 296
9
votes
5 answers

Starting vim-fugitive from command line

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
bradgonesurfing
  • 30,949
  • 17
  • 114
  • 217
1
2 3 4 5 6 7