Search code examples
vimdvcs

vim plugins for version control


There are plugins like vcscommand that work for (almost) any vcs and plugins like fugitive that are specific to one vcs.

  • What are the advantages/disadvantages of plugins like fugitive over vcscommand?
  • What plugins (or other tricks) do you use for versioning with vim?

Solution

    • What are the advantages/disadvantages of plugins like fugitive over vcscommand?

    The short answer

    VCSCommand works with many version control systems. Good if you have more than one in your organization -- same key mappings for all repos you work with.

    Fugitive is tight git-to-vim integration. Browsing and editing your git repository, index, and local files becomes seamless.

    The longer answer

    I use both. I think they compliment each other and don't have anything bad to say about either plugin, at least nothing that a few keymappings doesn't solve.

    VCSCommand is my research tool. I use it to log, annotate, diff, vimdiff and only occasionally commit (due to workplace workflow) and it works great. I switch between git and cvs repositories often and appreciate having the same mappings no matter what repo (directory) I'm using.

    Using the buffer variable b:VCSCommandVCSType and a key mapping, I'm also able to support two repositories in the same directory at work . (CVS/git -- not recommended for the fainthearted, but great for managing local edits with some practice and sane .gitignore rules.)

    Fugitive is a fantastic git-in-vim interface. I say git-in-vim because that's the best explanation I can think of. As I mentioned earlier it blurs the lines between your repository, index, and local files -- total freedom. Commands like 'Glog' and 'Gedit' are very intuitive and extremely useful.

    If you like git and vim, install fugitive. And pathogen. Pathogen takes the pain out of vim plugin management. Do it.

    • What plugins (or other tricks) do you use for versioning with vim?

    I highly recommend svndiff. svndiff at vim.org Despite its name, it works on many VCS's (git/svn/CVS.) Opening a modified file and hopping directly to the next/previous modified (or deleted/added) section is fantastic. You can see all your changes (visible in the window) at a glance. Your vim will need +signs compiled in but it's an amazing accelerator.

    Extradite for fugitive is also recommended for git commit browsing. http://int3.github.com/vim-extradite/