1. Steve Losh
  2. vermilion

Wiki

Clone wiki

vermilion / Planned_Features

Planned Features

Feel free to edit this page to add comments on how you think the commands should work (or to add *new* commands).

This plugin is heavily inspired by Fugitive. Fugitive is pretty awesome, so we should take ideas from it. However, if something doesn't make sense for Mercurial we shouldn't try to force it.

I'm still thinking of useful things to do with incoming/outgoing. Suggestions welcome.

I have no plans to support any semblance of Windows myself. We're going to shell out to Mercurial for most of the functionality, so if you want Windows support you'll need to send patches.

Protip: BitBucket stores wikis as Mercurial repos. Use hg clone ssh://hg@bitbucket.org/sjl/vermilion/wiki to get this wiki as a repo so you can edit pages with Vim! You'll probably also want to grab a syntax file for BitBucket's wiki markup.

Conventions:

Capital letters make tangible changes or perform an action on all items, lowercase letters do not.

"Highlighted" means either the visually selected items, or the item that the cursor is over if nothing is visually selected.

  • u: Update or move to something.
  • s: Show some revision.
  • d: Open up a diff of something.
  • r: Move the view to a specific revision.
  • R: Revert something.
  • E: Email something.
  • C: Commit something.
  • x: Mark/unmark something.
  • X: Mark everything.
  • Z: Unmark everything.
  • m: Load more of something.
  • v: Switch between verbose and non-verbose modes.

Hg <cmd>

Run the given Mercurial command.

Hgblame

Toggle an interactive blame split for the current file.

+-------------------------------------------------------------------------------------+
| 231   3 days ago   add a feature to ... | if (x < 1) {                              |
| 231   3 days ago   add a feature to ... |     print x;                              |
| 231   3 days ago   add a feature to ... | }                                         |
| 298    yesterday   fix issue 1234       |                                           |
| 298    yesterday   fix issue 1234       | if (y == null) {                          |
| 298    yesterday   fix issue 1234       |     y = 0;                                |
| 298    yesterday   fix issue 1234       | }                                         |
| 260   2 days ago   add another feature  |                                           |
| 231   3 days ago   add a feature to ... | print y;                                  |
+-------------------------------------------------------------------------------------+
  • s: Show patch for the highlighted revision.
  • b: Reblame for the highlighted revision.
  • r <rev>: Reblame on the specified revision.
  • v: Switch to verbose mode.

Hgblameverbose

Toggle an interactive verbose blame split for the current file.

+-------------------------------------------------------------------------------------+
| abf3c876b2bb   3 days ago   Steve Losh      add a feature to ... | if (x < 1) {     |
| abf3c876b2bb   3 days ago   Steve Losh      add a feature to ... |     print x;     |
| abf3c876b2bb   3 days ago   Steve Losh      add a feature to ... | }                |
| cbba22ae445d    yesterday   Nick Sergeant   fix issue 1234       |                  |
| cbba22ae445d    yesterday   Nick Sergeant   fix issue 1234       | if (y == null) { |
| cbba22ae445d    yesterday   Nick Sergeant   fix issue 1234       |     y = 0;       |
| cbba22ae445d    yesterday   Nick Sergeant   fix issue 1234       | }                |
| dd91b0rc23ba   2 days ago   Ali Ali         add another feature  |                  |
| abf3c876b2bb   3 days ago   Steve Losh      add a feature to ... | print y;         |
+-------------------------------------------------------------------------------------+
  • s: Show patch for the highlighted revision.
  • b: Reblame for the highlighted revision.
  • r <rev>: Reblame on the specified revision.
  • v: Switch to non-verbose mode.

Hgglog

Toggle an interactive glog split.

+-------------------------------------------------------------------------------------+
| o     926  fix issue 987     |                                                      |
| |                            |                                                      |
| | @   925  add a feature ... |                                                      |
| |/                           |                                                      |
| o     924  change the hel... |                                                      |
| |                            |                                                      |
| o     923  fix issue 1029    |                                                      |
| |\                           |                                                      |
| | o   922  translate the ... |                                                      |
| | |                          |                                                      |
| o |   921  add another fe... |                                                      |
| | |                          |                                                      |
| | o   920  fix issue 1922    |                                                      |
| | |                          |                                                      |
+-------------------------------------------------------------------------------------+
  • s: Show patch for the highlighted revision.
  • u: Update to the highlighted revision.
  • r <rev>: Center on the highlighted revision.
  • E: Email patches of the highlighted revision(s).
  • m: Load more revisions.
  • v: Switch to verbose mode.

Hgglogverbose

Toggle an interactive verbose glog split.

+-------------------------------------------------------------------------------------+
| o     2b3ab34823dc  Steve Losh      fix issue 987      |                            |
| |                                                      |                            |
| | @   81bc2a3bd343  Steve Losh      add a feature t... |                            |
| |/                                                     |                            |
| o     ccd32db3d66a  Nick Sergeant   change the help... |                            |
| |                                                      |                            |
| o     283bb2a33ef2  Ali Ali         fix issue 1029     |                            |
| |\                                                     |                            |
| | o   bb23a2ddef21  Steve Losh      translate the s... |                            |
| | |                                                    |                            |
| o |   ebf2e334f932  Ali Ali         add another fea... |                            |
| | |                                                    |                            |
| | o   dd345ef11323  Nick Sergeant   fix issue 1922     |                            |
| | |                                                    |                            |
+-------------------------------------------------------------------------------------+
  • s: Show patch for the highlighted revision.
  • u: Update to the highlighted revision.
  • r <rev>: Center on the highlighted revision.
  • E: Email patches of the highlighted revision(s).
  • m: Load more revisions.
  • v: Switch to non-verbose mode.

tn: I like your suggestion, I also currently have C-hjkl mapped to window movement. As long as I can remap these, I think these are good defaults for ancestry movement rather than hijacking unmodified hjkl which would feel weird to most vi users

  • C-j: Move to the first parent of the current changeset.
  • C-k: Move to the first child of the current changeset.
  • C-h: Move to the next sibling of the current changeset (wraps).
  • C-l: Move to the previous sibling of the current changeset (wraps).

The defintion of "sibling" changes depending on the action we just performed.

If we just moved down (i.e. from a child to a parent) then there is only one possible sibling -- the other changeset that was merged into the changeset we just came from.

If we just moved up (i.e. from a parent to a child) then there may be many siblings -- all children of the changeset we just came from.

I'm not sure if this is possible with Vim, but to me it seems like the easiest, most seamless way to navigate the DAG.

Example (X denotes the current line):

      o
      |
      | o
      |/
    X o


    C-K (up/child)


    X o
      |
      | o
      |/
      o


    C-L (right/sibling/next child)


      o
      |
    X | o
      |/
      o

Another example, the other way:

    X o
      |\
      | o
      | |
      o |
      | |


    C-J (down/parent)


      o
      |\
      | o
      | |
    X o |
      | |


    C-L (right/sibling/other parent)


      o
      |\
    X | o
      | |
      o |
      | |

I'm not sure how things would work if the last changeset we moved from wasn't a merge node. We can probably do something smart/intuitive.

Hglog

Toggle an interactive log split.

+-------------------------------------------------------------------------------------+
| 926  fix issue 987           |                                                      |
| 925  add a feature to sho... |                                                      |
| 924  change the help         |                                                      |
| 923  fix issue 1029          |                                                      |
| 922  translate the spanis... |                                                      |
| 921  add another feature ... |                                                      |
| 920  fix issue 1922          |                                                      |
| 919  fix the X comment       |                                                      |
| 918  edit the docs to men... |                                                      |
| 917  fix a typo in the docs  |                                                      |
| 916  fix issue 827           |                                                      |
| 915  fix issue 76            |                                                      |
| 914  show the current fil... |                                                      |
| 913  add a tag for revisi... |                                                      |
+-------------------------------------------------------------------------------------+
  • s: Show patch for the highlighted revision.
  • u: Update to the highlighted revision.
  • r <rev>: Center on the highlighted revision.
  • E: Email patches of the highlighted revision(s).
  • m: Load more revisions.
  • v: Switch to verbose mode.

Hglogverbose

Toggle an interactive verbose log split.

+-------------------------------------------------------------------------------------+
| ba65e5201923  Steve Losh      fix issue 987           |                             |
| a22b384721ae  Steve Losh      add a feature to sho... |                             |
| e4f293abeffe  Ali Ali         change the help         |                             |
| e12334aaab21  Nick Sergeant   fix issue 1029          |                             |
| 5baab11edc23  Ali Ali         translate the spanis... |                             |
| ab09eff2ab12  Ali Ali         add another feature ... |                             |
| 7ab112e2ff42  Steve Losh      fix issue 1922          |                             |
| e22fb11afee1  Steve Losh      fix the X comment       |                             |
| b3332ababab2  Nick Sergeant   edit the docs to men... |                             |
| 4aae2ff3e212  Nick Sergeant   fix a typo in the docs  |                             |
| 123123b43a2a  Steve Losh      fix issue 827           |                             |
| 4eeef3eea2a1  Ali Ali         fix issue 76            |                             |
| 54baedcf1113  Ali Ali         show the current fil... |                             |
| 45ba11a2aa21  Nick Sergeant   add a tag for revisi... |                             |
+-------------------------------------------------------------------------------------+
  • s: Show patch for the highlighted revision.
  • u: Update to the highlighted revision.
  • r <rev>: Center on the highlighted revision.
  • E: Email patches of the highlighted revision(s).
  • m: Load more revisions.
  • v: Switch to non-verbose mode.

Hgfilelog

Toggle an interactive log split for the given file.

+-------------------------------------------------------------------------------------+
| 926  fix issue 987           |                                                      |
| 925  add a feature to sho... |                                                      |
| 823  fix issue 1029          |                                                      |
| 821  add another feature ... |                                                      |
| 720  fix issue 1922          |                                                      |
| 514  show the current fil... |                                                      |
|  13  add a tag for revisi... |                                                      |
+-------------------------------------------------------------------------------------+
  • s: Show patch for the highlighted revision.
  • u: Update to the highlighted revision.
  • r <rev>: Center on the highlighted revision (or the closest one to it.
  • R: Revert the file's contents to the given revision.
  • E: Email patches of the highlighted revision(s).
  • m: Load more revisions.
  • v: Switch to verbose mode.

Hgfilelogverbose

Toggle an interactive verbose log split for the given file.

+-------------------------------------------------------------------------------------+
| ba65e5201923  Steve Losh      fix issue 987           |                             |
| a22b384721ae  Steve Losh      add a feature to sho... |                             |
| e12334aaab21  Nick Sergeant   fix issue 1029          |                             |
| ab09eff2ab12  Ali Ali         add another feature ... |                             |
| 7ab112e2ff42  Steve Losh      fix issue 1922          |                             |
| 54baedcf1113  Ali Ali         show the current fil... |                             |
| 45ba11a2aa21  Nick Sergeant   add a tag for revisi... |                             |
+-------------------------------------------------------------------------------------+
  • s: Show patch for the highlighted revision.
  • u: Update to the highlighted revision.
  • r <rev>: Center on the highlighted revision (or the closest one to it.
  • R: Revert the file's contents to the given revision.
  • E: Email patches of the highlighted revision(s).
  • m: Load more revisions.
  • v: Switch to non-verbose mode.

Hgdiff

Open a diff of all changes in the working directory.

Hgshow <rev>

Show the given revision in a split.

Basically this opens hg export <rev> in a split with some nice syntax highlighting and folding.

Hgcommit

Commit changes, using Vim to write the commit message.

Hgrecord

Run hg record with Vim to make it not suck.

sjl: We could really go crazy with this, to allow hunk selection/editing. It would need someone a lot more comfortable with vimscript than me though.

Hgmove <newpath>

Move the current buffer's file to newpath and rename the buffer.

Hgremove

Remove the current buffer's file and delete the buffer.

Hgstatus

Toggle an interactive status split.

+-------------------------------------------------------------------------------------+
|   A docs/new.txt             |                                                      |
| x A docs/another.txt         |                                                      |
| x R api/old.py               |                                                      |
| x M api/pack/protocol.py     |                                                      |
|   M api/pack/interface.py    |                                                      |
|   M tests/packui.t           |                                                      |
|   M tests/packapi.t          |                                                      |
|                              |                                                      |
|                              |                                                      |
|                              |                                                      |
|                              |                                                      |
|                              |                                                      |
|                              |                                                      |
|                              |                                                      |
+-------------------------------------------------------------------------------------+
  • d: Open a diff of the highlighted file(s) in a split.
  • R: Revert the highlighted file(s).
  • x: Mark/unmark file for commit.
  • X: Mark all files for commit.
  • Z: Unmark all files for commit.
  • C: Commit marked files.

sjl: Should C commit all files if nothing is marked, or should we make people use :Hgcommit to do that to avoid ambiguity?

Hgmerge

Merge, using Vim to fix conflicts.

Hgq

Toggle an interactive MQ split.

+-------------------------------------------------------------------------------------+
|   add-xyx      add xyz       |                                                      |
|   add-abc      add abc       |                                                      |
| * api-changes  modify api... |                                                      |
|   fix-cmdx     fix commen... |                                                      |
|   fix-help     fix the he... |                                                      |
|                              |                                                      |
|                              |                                                      |
|                              |                                                      |
|                              |                                                      |
|                              |                                                      |
|                              |                                                      |
|                              |                                                      |
|                              |                                                      |
|                              |                                                      |
+-------------------------------------------------------------------------------------+
  • u: Move to the highlighted patch.
  • p: Push the topmost unapplied patch.
  • P: Pop the topmost applied patch.
  • F: Fold the highlighted patches together.

Hgqrefresh

Refresh the current patch with current changes.

Hgqmessage

Edit the current patch's commit message with Vim.

Hgqqueue

Toggle an interactive list of MQ queues.

+-------------------------------------------------------------------------------------+
|   feature-y (2 patches)      |                                                      |
|   feature-x (6 patches)      |                                                      |
|   fix-192 (12 patches)       |                                                      |
| * fix-1200 (3 patches)       |                                                      |
|   default (1 patch)          |                                                      |
|                              |                                                      |
|                              |                                                      |
|                              |                                                      |
|                              |                                                      |
|                              |                                                      |
|                              |                                                      |
|                              |                                                      |
|                              |                                                      |
|                              |                                                      |
+-------------------------------------------------------------------------------------+
  • u: Switch to the highlighted queue.
  • D: Delete the highlighted queue.
  • N: Create a new queue.

Hgqfinish

Finish the current MQ patch.

If it doesn't have a commit message already open a Vim split to make one.

%{vermilion#statusline()}

Put this in your statusline to add the following to your status line:

(at REVISION on BRANCH)

It would look like this:

(at 234 on default)

Updated