Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Vim syntax file for hg commit file
diff -r 942df3a8051b -r 1dd8790a0648 runtime/filetype.vim
--- a/runtime/filetype.vim Mon Jul 16 19:27:29 2012 +0200
+++ b/runtime/filetype.vim Thu Aug 02 00:50:57 2012 +0900
@@ -1119,6 +1119,9 @@
" Maya Extension Language
au BufNewFile,BufRead *.mel setf mel
+" Mercurial (hg) commit file
+au BufNewFile,BufRead hg-editor-*.txt setf hgcommit
" Mercurial config (looks like generic config file)
au BufNewFile,BufRead *.hgrc,*hgrc setf cfg
diff -r 942df3a8051b -r 1dd8790a0648 runtime/syntax/hgcommit.vim
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/runtime/syntax/hgcommit.vim Thu Aug 02 00:50:57 2012 +0900
@@ -0,0 +1,27 @@
+" Vim syntax file
+" Language: hg (Mercurial) commit file
+" Maintainer: Ken Takata <kentkt at csc dot jp>
+" Last Change: 2012 Aug 2
+" Filenames: hg-editor-*.txt
+" License: VIM License
+" URL:
+if exists("b:current_syntax")
+ finish
+syn match hgcommitComment "^HG:.*$"
+syn match hgcommitUser "^HG: user: \zs.*$" contained containedin=hgcommitComment
+syn match hgcommitBranch "^HG: branch \zs.*$" contained containedin=hgcommitComment
+syn match hgcommitAdded "^HG: \zsadded .*$" contained containedin=hgcommitComment
+syn match hgcommitChanged "^HG: \zschanged .*$" contained containedin=hgcommitComment
+syn match hgcommitRemoved "^HG: \zsremoved .*$" contained containedin=hgcommitComment
+hi def link hgcommitComment Comment
+hi def link hgcommitUser String
+hi def link hgcommitBranch String
+hi def link hgcommitAdded Identifier
+hi def link hgcommitChanged Special
+hi def link hgcommitRemoved Constant
+let b:current_syntax = "hgcommit"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.