Differences between revisions 6 and 7
Revision 6 as of 2013-09-01 11:00:11
Size: 1085
Comment: Spam
Revision 7 as of 2014-11-04 19:45:54
Size: 1005
Editor: techtonik
Comment: update doc
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
'''Note:''' Recent versions of hgeditor (e.g. [[http://mercurial.selenic.com/hg/hg-stable/raw-file/tip/hgeditor|tip's]]) include this functionality already. (i.e. you don't have to do anything!) '''NOTE:''' This instruction is no more actual. Recent versions of [[hgeditor]] do everything below automatically.

See diffs when editing commit message with VIM

NOTE: This instruction is no more actual. Recent versions of hgeditor do everything below automatically.

Make a private copy of the hgeditor script provided with Mercurial and replace the call to the editor with following command:

vim "+e $HGTMP/diff" '+set buftype=help filetype=diff' "+vsplit $HGTMP/msg" || exit $?

This will start up VIM in vertical split mode with commit message in the left pane and diff in the right pane. The buftype=help setting for diff window tells vim to exit when all other windows are closed, so when you write and quit the log with :x (:wq - they are equivalent), vim exits. If you have syntax highlight set up, the diff will be properly highlighted.

This setting is suitable for wide terminals. If you have a narrow terminal, you may want to replace the +vsplit above with +split or add nowrap to the +set.


DiffsInCommitMessageInVIM (last edited 2014-11-04 19:45:54 by techtonik)