comparison syntax/hgcommit.vim @ 7:adc267e2f0f4

Added syntax highlighting for hgstatus window.
author Ludovic Chabant <ludovic@chabant.com>
date Fri, 09 Dec 2011 23:08:53 -0800
parents
children
comparison
equal deleted inserted replaced
6:1da613c13d81 7:adc267e2f0f4
1 " Vim syntax file
2 " Language: hg commit file
3 " Maintainer: Pierre Bourdon <delroth@gmail.com>
4 " Filenames: ^hg-editor-*.txt
5 " Last Change: 2010 Jun 13
6
7 " Some parts of the code by Dan LaMotte <lamotte85@gmail.com>
8
9 if exists("b:current_syntax")
10 finish
11 endif
12
13 syn case match
14 syn sync minlines=50
15
16 if has("spell")
17 syn spell toplevel
18 endif
19
20 syn match hgcommitFirstline "\%^.*" nextgroup=hgcommitBlank skipnl
21 syn match hgcommitSummary "^.\{0,78\}" contained containedin=hgcommitFirstline nextgroup=hgcommitOverflow contains=@Spell
22 syn match hgcommitOverflow ".*" contained contains=@Spell
23 syn match hgcommitBlank "^HG:\@!.*" contained contains=@Spell
24
25 syn match hgcommitComment "^HG:.*"
26
27 syn match hgcommitOnBranch "\%(^HG: \)\@<=\<branch\> '" contained containedin=hgcommitComment nextgroup=hgcommitBranch
28 syn match hgcommitBranch "[^']\+" contained
29 syn match hgcommitAdded "\%(^HG: \)\@<=\<added\>" contained containedin=hgcommitComment nextgroup=hgcommitFile
30 syn match hgcommitChanged "\%(^HG: \)\@<=\<changed\>" contained containedin=hgcommitComment nextgroup=hgcommitFile
31 syn match hgcommitRemoved "\%(^HG: \)\@<=\<removed\>" contained containedin=hgcommitComment nextgroup=hgcommitFile
32 syn match hgcommitFile " \S\+" contained containedin=hgcommitAdded,hgcommitChanged
33
34 hi def link hgcommitSummary Keyword
35 hi def link hgcommitOverflow Error
36 hi def link hgcommitBlank Error
37
38 hi def link hgcommitComment Comment
39 hi def link hgcommitOnBranch Comment
40 hi def link hgcommitBranch Special
41 hi def link hgcommitOnBranchEnd Comment
42 hi def link hgcommitAdded Type
43 hi def link hgcommitChanged Type
44 hi def link hgcommitRemoved Type
45 hi def link hgcommitFile Constant
46