Use revision control annotation in your editor

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.

This entry was posted in Videos and tagged , , , , . Bookmark the permalink.
  • Gavin Miller

    Thanks for the tip Avdi – really powerful.

    Does anyone know of similar functionality in vim? Closest I could find was VCSCommand[1] however I’m not sure it goes as far as Avdi does here.


    • Mike Foley

      I use the Fugitive plugin for Vim. I love the convenience for git diff and blame.

      • nprasanna

        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’.

  • Jon-Michael Deldin

    vc-annotate brings me one step closer to Emacs for everything. Thanks for sharing!

  • SairamKunala

    Anyone know any for TextMate ?

  • Pingback: vc-annotate | Irreal

  • mns

    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 ?

    • Avdi Grimm


  • Kristian Hellquist

    Thanks for the tip. You don’t use magit? I found it a bit a slow sometimes.

    • Avdi Grimm

      Magit is indispensable! Best ui for git anywhere.

      • Kristian Hellquist

        You use both vc-* and magit? What is vc-* doing better than magit? Love to hear your take on that :-)

        • Avdi Grimm

          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!

          • Kristian Hellquist

            Great, thanks. I’ll start investigating vc-mode

  • Alexander Petrov

    Absolutely amazing! Avdi, you made my day! Thank you very much! Now I love emacs far more! Emacs rocks!

    • Avdi Grimm