blob: e9f31bef610452adc835611ba545ab3885e3f410 [file] [log] [blame]
Bram Moolenaar9b451252012-08-15 17:43:31 +02001" Vim syntax file
Bram Moolenaarf1dcd142022-12-31 15:30:45 +00002" Language: hg/sl (Mercurial / Sapling) commit file
Bram Moolenaar9b451252012-08-15 17:43:31 +02003" Maintainer: Ken Takata <kentkt at csc dot jp>
Bram Moolenaarf1dcd142022-12-31 15:30:45 +00004" Max Coplan <mchcopl@gmail.com>
5" Last Change: 2022-12-08
Bram Moolenaar9b451252012-08-15 17:43:31 +02006" License: VIM License
7" URL: https://github.com/k-takata/hg-vim
8
9if exists("b:current_syntax")
10 finish
11endif
12
Bram Moolenaarf1dcd142022-12-31 15:30:45 +000013syn match hgcommitComment "^\%(SL\|HG\): .*$" contains=@NoSpell
14syn match hgcommitUser "^\%(SL\|HG\): user: \zs.*$" contains=@NoSpell contained containedin=hgcommitComment
15syn match hgcommitBranch "^\%(SL\|HG\): branch \zs.*$" contains=@NoSpell contained containedin=hgcommitComment
16syn match hgcommitAdded "^\%(SL\|HG\): \zsadded .*$" contains=@NoSpell contained containedin=hgcommitComment
17syn match hgcommitChanged "^\%(SL\|HG\): \zschanged .*$" contains=@NoSpell contained containedin=hgcommitComment
18syn match hgcommitRemoved "^\%(SL\|HG\): \zsremoved .*$" contains=@NoSpell contained containedin=hgcommitComment
19
20syn region hgcommitDiff start=/\%(^\(SL\|HG\): diff --\%(git\|cc\|combined\) \)\@=/ end=/^\%(diff --\|$\|@@\@!\|[^[:alnum:]\ +-]\S\@!\)\@=/ fold contains=@hgcommitDiff
21syn include @hgcommitDiff syntax/shared/hgcommitDiff.vim
Bram Moolenaar9b451252012-08-15 17:43:31 +020022
23hi def link hgcommitComment Comment
24hi def link hgcommitUser String
25hi def link hgcommitBranch String
26hi def link hgcommitAdded Identifier
27hi def link hgcommitChanged Special
28hi def link hgcommitRemoved Constant
29
30let b:current_syntax = "hgcommit"