Syntax file for hg commit message

335 views
Skip to first unread message

Ken Takata

unread,
Jul 18, 2012, 8:16:57 AM7/18/12
to vim...@googlegroups.com
Hi all,

I wrote a syntax file for hg (Mercurial) commit message.
I'm not familiar with hg and Vim syntax file, but any comments are welcome.
https://gist.github.com/3129572

I wonder why Vim uses hg for SCM but Vim doesn't have a syntax file for that.


BTW, I have posted several messages to this ML, but some of my posts
are not found on the Web interface. Is my e-mail address blocked?
For example, only Bram's response can be seen in the following thread:
https://groups.google.com/d/topic/vim_dev/Me2Q6HDtC1I/discussion

Regards,
Ken Takata

Ingo Karkat

unread,
Jul 18, 2012, 8:51:25 AM7/18/12
to vim...@googlegroups.com
On 18-Jul-2012 14:16:57 +0200, Ken Takata wrote:

> Hi all,
>
> I wrote a syntax file for hg (Mercurial) commit message.
> I'm not familiar with hg and Vim syntax file, but any comments are welcome.
> https://gist.github.com/3129572
>
> I wonder why Vim uses hg for SCM but Vim doesn't have a syntax file for that.

Dan LaMotte has already written such a file, but the attempt to get it included
apparently fizzled out.
http://vim.1045645.n5.nabble.com/hg-commit-syntax-file-td1205296.html

Superficially, yours looks similar to his, but maybe you'll find something in
there that you haven't considered yet. I'd definitely welcome an inclusion in
the Vim runtime.

-- regards, ingo

Ken Takata

unread,
Jul 21, 2012, 9:46:11 AM7/21/12
to vim...@googlegroups.com
Hi,

I have updated the patch.
https://gist.github.com/3129572
(Hg comment lines begin with 'HG:' not 'HG: '.)

The same file (but not a patch) is also available at
https://github.com/k-takata/hg-vim .

2012/07/18 21:51:25 UTC+9 Ingo Karkat:


> Dan LaMotte has already written such a file, but the attempt to get it included
> apparently fizzled out.
> http://vim.1045645.n5.nabble.com/hg-commit-syntax-file-td1205296.html

Thanks for your comment.
Hmm, it seems that Dan's file was not included because of copyright problem.

> Superficially, yours looks similar to his, but maybe you'll find something in
> there that you haven't considered yet. I'd definitely welcome an inclusion in
> the Vim runtime.

I looked into his file.
I think mine is a little bit simpler and it's enough.
An obvious difference can be seen when coloring the following lines:

HG: added file1
HG: changed file2
HG: removed file3

Mine:
The status (added, changed or removed) and the file name use the same color.
Each status uses a different color. (same as svn.vim)

His:
The status and the file name use different colors.
All status use the same color.

Regards,
Ken Takata

Ingo Karkat

unread,
Jul 21, 2012, 3:01:04 PM7/21/12
to vim...@googlegroups.com
I like the different highlighting of added / changed / removed. Having a
different group for the file name is probably less important, but would be easy
to add, too.

One more request, though: Wouldn't it be more appropriate to name the syntax
"hgcommit", because it's more precise, and for future compatibility? Though many
proponents frown on those comparisons, a look at the _other_ favorite DVCS
reveals that they have gitcommit.vim + gitconfig.vim + gitrebase.vim +
gitsendemail.vim already. Maybe the Mercurial support in Vim will grow
similarly, and then your syntax would have taken up the core "hg.vim" name already.

-- regards, ingo

Ken Takata

unread,
Aug 1, 2012, 6:44:50 PM8/1/12
to vim...@googlegroups.com
Hi,

2012/07/22 4:01:04 UTC+9 Ingo Karkat:


> I like the different highlighting of added / changed / removed. Having a
>
> different group for the file name is probably less important, but would be easy
>
> to add, too.

I don't think it is important, but if you send me a pull request, I will include it.

> One more request, though: Wouldn't it be more appropriate to name the syntax
>
> "hgcommit", because it's more precise, and for future compatibility?

OK, I changed the name from "hg" to "hgcommit".
A patch for filetype.vim was also updated.
https://gist.github.com/3129572
(https://github.com/k-takata/hg-vim)


Bram,
I think it is now ready for inclusion.
I hope this would be a help for hg users and also for Vim contributors.

Thank you.
--
Regards,
Ken Takata

Bram Moolenaar

unread,
Aug 2, 2012, 7:22:33 AM8/2/12
to Ken Takata, vim...@googlegroups.com
Thanks! I'll include it.

If you make improvements, please email me the new file.

--
Some of the well know MS-Windows errors:
EMEMORY Memory error caused by..., eh...
ELICENSE Your license has expired, give us more money!
EMOUSE Mouse moved, reinstall Windows
EILLEGAL Illegal error, you are not allowed to see this
EVIRUS Undetectable virus found

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Ken Takata

unread,
Aug 21, 2012, 9:58:56 AM8/21/12
to vim...@googlegroups.com, Ken Takata
Hi Bram,

I have updated syntax/hgcommit.vim.
I merged a patch from Audrius Kažukauskas:
"Disable spell checking in comment blocks."

The latest version is available at here:
https://github.com/k-takata/hg-vim/blob/master/syntax/hgcommit.vim

Best regards,
Ken Takata

Bram Moolenaar

unread,
Aug 23, 2012, 11:03:40 AM8/23/12
to Ken Takata, vim...@googlegroups.com

Ken Takata wrote:

> I have updated syntax/hgcommit.vim.
> I merged a patch from Audrius Kažukauskas:
> "Disable spell checking in comment blocks."
>
> The latest version is available at here:
> https://github.com/k-takata/hg-vim/blob/master/syntax/hgcommit.vim

Thanks, I have included it.

It's easier for me if you email the new version. Also for archiving
reasons.

--
In war we're tough and able.
Quite indefatigable
Between our quests
We sequin vests
And impersonate Clark Gable
It's a busy life in Camelot.
I have to push the pram a lot.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

Ken Takata

unread,
Jan 6, 2016, 10:00:42 AM1/6/16
to vim_dev
Hi Bram,

2012/8/24 Fri 0:03:40 UTC+9 Bram Moolenaar wrote:
> Ken Takata wrote:
>
> > I have updated syntax/hgcommit.vim.
> > I merged a patch from Audrius Kažukauskas:
> > "Disable spell checking in comment blocks."
> >
> > The latest version is available at here:
> > https://github.com/k-takata/hg-vim/blob/master/syntax/hgcommit.vim
>
> Thanks, I have included it.
>
> It's easier for me if you email the new version. Also for archiving
> reasons.

I have updated the hgcommit plugin. Now it has ftplugin.
Please include this. (Note: syntax/hgcommit.vim is not updated.)

Regards,
Ken Takata
hgcommit.zip

Bram Moolenaar

unread,
Jan 7, 2016, 12:27:17 PM1/7/16
to Ken Takata, vim_dev

Ken Takata wrote:

> I have updated the hgcommit plugin. Now it has ftplugin.
> Please include this. (Note: syntax/hgcommit.vim is not updated.)

Thanks!

--
So when I saw the post to comp.editors, I rushed over to the FTP site to
grab it. So I yank apart the tarball, light x candles, where x= the
vim version multiplied by the md5sum of the source divided by the MAC of
my NIC (8A3FA78155A8A1D346C3C4A), put on black robes, dim the lights,
wave a dead chicken over the hard drive, and summon the power of GNU GCC
with the magic words "make config ; make!".
[Jason Spence, compiling Vim 5.0]
Reply all
Reply to author
Forward
0 new messages