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 开发者_Go百科plugins like fugitive over vcscommand?
- What plugins (or other tricks) do you use for versioning with vim?
- 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/
I'm happy running the command line tools from within vim using ":!" for version control. You could also write your own macros and key bindings to speed repeated operations. Also, consider adding such operations to your build system (e.g. Maekfile). However, I find it easier to remember the command line options for svn, hg, git, etc.
I use airblade/vim-gitgutter to display git diff
symbols inside of the sign column (i.e., beside line numbers).
I'm using vcscommand
plugin because I am lazy. I don't have to write my own macros because they are already written. All you have to type is a ,sd
and there it is, the diff you wanted. Why reinvent the wheel? Anyway, the true is that plugins don't have all the subcommands of the command line tools. So, if you are using quite often other subcommands than the usual ones (commit, update, diff etc) start writing your own macros.
精彩评论