The Best Git UI for Vim: Fugitive
Tim Pope, known to many Vim (and Rails) users as just tpope, very well known for his many vim- projects (including the infamous pathogen plugin), has this to say about his Fugitive plugin for Vim:
I’m not going to lie to you; fugitive.vim may very well be the best Git wrapper of all time. Check out these features: […]
And he didn’t lie. Fugitive is so awesome it may well be the reason for you to switch to Vim right fucking now. But of course, you are already using Vim, aren’t you? Oh and if you’re not using Git, you absolutely suck. :P
So, I’m not going to go all in-dept. Instead, I’ll point to you vimcasts.org, where Drew is showing you how to use it in his typically thorough, and awesome style.
What makes Fugitive really great is the fact that it actually does more for you than what you’d get using just Git.
One of the awesome features that I enjoy using is the vimdiff view of unstaged changes. (I started using vimdiff because of Fugitive, too.) What Fugitive does is it gives you a side-by-side of changes that are staged, and the working version of your file. Not only can you clearly see what’s changed since last git commit (or git add), you can also hand-pick changes you want to move into the staged version. Of course, just being able to preview the changes is quite awesome on its own.
Another cool thing is it makes the git-status output interacitve. So you can go to a file mentioned in git-status output inside a Vim buffer, and you can press - to stage or unstage it. And then you can just press S-C (Shift + C) to commit the staged changes.
Merge conflicsts have also been my pain point. It’s quite easy to loose track of those markers, isn’t it? Well, with Fugitive, you get a three-way vimdiff, with target on the left, and source on the right, and the conflict in the middle. You can pick and merge parts of the source or target just like when you want to stage small chunks of changes.
Ok, so those are my three favorites, but Fugitive actually packs a whole lot more, so I encourage you to give it a spin.




