I was discussing comments vs. intention-revealing code with some folks on Twitter today and I realize that there’s a tool I take so much for granted I don’t even think about it any more. The tool is called VC-Annotate in Emacs, but some form of it should exist in every decent editor.
If you’re a programmer and you’re not using your editor’s revision control annotation features, I strongly recommend learning about them ASAP. They are an essential tool in understanding the story behind the code.
httpv://youtube.com/watch?v=rjnm-suxfRI
Thanks for the tip Avdi – really powerful.
Does anyone know of similar functionality in vim? Closest I could find was VCSCommand1 however I’m not sure it goes as far as Avdi does here.
I use the Fugitive plugin for Vim. I love the convenience for git diff and blame.
Yeah.. Tim Pope’s Fugitive does exactly that. Just type :Gblame in normal mode and you’ll see the exact thing what Avdi is showing here. You can open each commit shown in that view by pressing ‘o’.
vc-annotate brings me one step closer to Emacs for everything. Thanks for sharing!
Anyone know any for TextMate ?
Just came across this. Never realised how much under-used VC is in my workflows. I’ll have to see if this works with Perforce as well. Thanks for the tip.
BTW, what’s the colour scheme you’re using in there ?
ZenBurn
Thanks for the tip. You don’t use magit? I found it a bit a slow sometimes.
Magit is indispensable! Best ui for git anywhere.
You use both vc-* and magit? What is vc-* doing better than magit? Love to hear your take on that 🙂
There is actually very little overlap between the two. Magit is for managing a whole project under revision control. It’s what I use when I’m selecting files/hunks for a commit, for instance. Or pushing, pulling, rebasing—anything that takes effect project-wide.
vc-mode, OTOH, is totally buffer/file-focused. It won’t show you the state of your whole project, but it will tell you quite a bit about the file you are currently looking at.
In short: they are complementary!
Great, thanks. I’ll start investigating vc-mode
Absolutely amazing! Avdi, you made my day! Thank you very much! Now I love emacs far more! Emacs rocks!
😀