wiki:HGRev

HGRev

HGRev is a small plugin that can find the current buffer's revision ID from a  Mercurial repository.

It is intended for use in the Vim statusline- here's an example to enable it:

set statusline=[r%{HGRev()}] 

HGRev exports the HGRev() function (for use in the statusline), and a command called :RefreshMercurialRev, which you can use to manually update the revision information for the current buffer. If you've added HGRev() to your statusline, you'll see the file revision, branch, tags, and file status reflected -- if you used the statusline example above, you should see something like this:

[r192+ default tip M]

The information displayed can be easily customized, and HGRev can also automatically update the status line on file changes. (This behavior is disabled by default.)

Downloads

You can download the latest build directly from  Vim's web site, or if you're feeling adventurous you can build it yourself from  here.

Installation

!HGRev requires the  VimBall packager. Install the VimBall plugin (vimscript #1502) if you don't already have it.

Then, open the hgrev.vba.gz file within vim, and run the following command:

 :so %

VimBall takes care of putting the files in the right locations and automatically updating the help index.

Development

You can also check out the source via  Mercurial from the following uri:

% hg clone http://code.martini.nu/vim-stuff/

Documentation

Once installed, HGRev has built-in help. Access it via :help HGRev.