Mercurial > vim
annotate runtime/syntax/debcontrol.vim @ 5564:cf722c092360 v7.4.130
updated for version 7.4.130
Problem: Relative line numbers mix up windows when using folds.
Solution: Use hasFoldingWin() instead of hasFolding(). (Lech Lorens)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sat, 14 Dec 2013 12:48:58 +0100 |
parents | 605c9ce57ec3 |
children | 1dea14d4c738 |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2152 | 2 " Language: Debian control files |
857 | 3 " Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org> |
4 " Former Maintainers: Gerfried Fuchs <alfie@ist.org> | |
5 " Wichert Akkerman <wakkerma@debian.org> | |
4502
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
4229
diff
changeset
|
6 " Last Change: 2013 May 05 |
2908 | 7 " URL: http://anonscm.debian.org/hg/pkg-vim/vim/raw-file/unstable/runtime/syntax/debcontrol.vim |
7 | 8 |
9 " Standard syntax initialization | |
10 if version < 600 | |
11 syntax clear | |
12 elseif exists("b:current_syntax") | |
13 finish | |
14 endif | |
15 | |
1624 | 16 " Should match case except for the keys of each field |
17 syn case match | |
18 | |
7 | 19 " Everything that is not explicitly matched by the rules below |
20 syn match debcontrolElse "^.*$" | |
21 | |
22 " Common seperators | |
23 syn match debControlComma ", *" | |
24 syn match debControlSpace " " | |
25 | |
26 " Define some common expressions we can use later on | |
3099
887d6d91882e
Updated a few runtime files.
Bram Moolenaar <bram@vim.org>
parents:
2908
diff
changeset
|
27 syn match debcontrolArchitecture contained "\%(all\|linux-any\|\%(any-\)\=\%(alpha\|amd64\|arm\%(e[bl]\|hf\)\=\|avr32\|hppa\|i386\|ia64\|lpia\|m32r\|m68k\|mips\%(el\)\=\|powerpc\|ppc64\|s390x\=\|sh[34]\(eb\)\=\|sh\|sparc\%(64\)\=\)\|hurd-\%(i386\|any\)\|kfreebsd-\%(i386\|amd64\|any\)\|knetbsd-\%(i386\|any\)\|kopensolaris-\%(i386\|any\)\|netbsd-\%(alpha\|i386\|any\)\|any\)" |
2908 | 28 syn match debcontrolMultiArch contained "\%(no\|foreign\|allowed\|same\)" |
1624 | 29 syn match debcontrolName contained "[a-z0-9][a-z0-9+.-]\+" |
7 | 30 syn match debcontrolPriority contained "\(extra\|important\|optional\|required\|standard\)" |
3513 | 31 syn match debcontrolSection contained "\v((contrib|non-free|non-US/main|non-US/contrib|non-US/non-free|restricted|universe|multiverse)/)?(admin|cli-mono|comm|database|debian-installer|debug|devel|doc|editors|education|electronics|embedded|fonts|games|gnome|gnustep|gnu-r|graphics|hamradio|haskell|httpd|interpreters|introspection|java|kde|kernel|libs|libdevel|lisp|localization|mail|math|metapackages|misc|net|news|ocaml|oldlibs|otherosfs|perl|php|python|ruby|science|shells|sound|text|tex|utils|vcs|video|web|x11|xfce|zope)" |
1624 | 32 syn match debcontrolPackageType contained "u\?deb" |
7 | 33 syn match debcontrolVariable contained "\${.\{-}}" |
1668 | 34 syn match debcontrolDmUpload contained "\cyes" |
7 | 35 |
1624 | 36 " A URL (using the domain name definitions from RFC 1034 and 1738), right now |
37 " only enforce protocol and some sanity on the server/path part; | |
38 syn match debcontrolHTTPUrl contained "\vhttps?://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?$" | |
39 syn match debcontrolVcsSvn contained "\vsvn%(\+ssh)?://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?$" | |
40 syn match debcontrolVcsCvs contained "\v%(\-d *)?:pserver:[^@]+\@[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?:/[^[:space:]]*%( [^[:space:]]+)?$" | |
4502
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
4229
diff
changeset
|
41 syn match debcontrolVcsGit contained "\v%(git|http)://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?%(\s+-b\s+[^ ~^:?*[\\]+)?$" |
1624 | 42 |
7 | 43 " An email address |
44 syn match debcontrolEmail "[_=[:alnum:]\.+-]\+@[[:alnum:]\./\-]\+" | |
45 syn match debcontrolEmail "<.\{-}>" | |
46 | |
1624 | 47 " #-Comments |
3893 | 48 syn match debcontrolComment "^#.*$" contains=@Spell |
1624 | 49 |
50 syn case ignore | |
51 | |
7 | 52 " List of all legal keys |
4229 | 53 syn match debcontrolKey contained "^\%(Source\|Package\|Section\|Priority\|\%(XSBC-Original-\)\=Maintainer\|Uploaders\|Build-\%(Conflicts\|Depends\)\%(-Indep\)\=\|Standards-Version\|\%(Pre-\)\=Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Enhances\|Breaks\|Essential\|Architecture\|Multi-Arch\|Description\|Bugs\|Origin\|X[SB]-Python-Version\|Homepage\|\(XS-\)\=Vcs-\(Browser\|Arch\|Bzr\|Cvs\|Darcs\|Git\|Hg\|Mtn\|Svn\)\|\%(XC-\)\=Package-Type\): *" |
54 | |
55 syn match debcontrolDeprecatedKey contained "^\%(\%(XS-\)\=DM-Upload-Allowed\): *" | |
7 | 56 |
57 " Fields for which we do strict syntax checking | |
58 syn region debcontrolStrictField start="^Architecture" end="$" contains=debcontrolKey,debcontrolArchitecture,debcontrolSpace oneline | |
2908 | 59 syn region debcontrolStrictField start="^Multi-Arch" end="$" contains=debcontrolKey,debcontrolMultiArch oneline |
7 | 60 syn region debcontrolStrictField start="^\(Package\|Source\)" end="$" contains=debcontrolKey,debcontrolName oneline |
61 syn region debcontrolStrictField start="^Priority" end="$" contains=debcontrolKey,debcontrolPriority oneline | |
62 syn region debcontrolStrictField start="^Section" end="$" contains=debcontrolKey,debcontrolSection oneline | |
2908 | 63 syn region debcontrolStrictField start="^\%(XC-\)\=Package-Type" end="$" contains=debcontrolKey,debcontrolPackageType oneline |
1624 | 64 syn region debcontrolStrictField start="^Homepage" end="$" contains=debcontrolKey,debcontrolHTTPUrl oneline keepend |
2034 | 65 syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-\%(Browser\|Arch\|Bzr\|Darcs\|Hg\)" end="$" contains=debcontrolKey,debcontrolHTTPUrl oneline keepend |
66 syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-Svn" end="$" contains=debcontrolKey,debcontrolVcsSvn,debcontrolHTTPUrl oneline keepend | |
67 syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-Cvs" end="$" contains=debcontrolKey,debcontrolVcsCvs oneline keepend | |
68 syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-Git" end="$" contains=debcontrolKey,debcontrolVcsGit oneline keepend | |
4229 | 69 syn region debcontrolStrictField start="^\%(XS-\)\=DM-Upload-Allowed" end="$" contains=debcontrolDeprecatedKey,debcontrolDmUpload oneline |
7 | 70 |
71 " Catch-all for the other legal fields | |
2034 | 72 syn region debcontrolField start="^\%(\%(XSBC-Original-\)\=Maintainer\|Standards-Version\|Essential\|Bugs\|Origin\|X[SB]-Python-Version\|\%(XS-\)\=Vcs-Mtn\):" end="$" contains=debcontrolKey,debcontrolVariable,debcontrolEmail oneline |
2152 | 73 syn region debcontrolMultiField start="^\%(Build-\%(Conflicts\|Depends\)\%(-Indep\)\=\|\%(Pre-\)\=Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Enhances\|Breaks\|Uploaders\|Description\):" skip="^ " end="^$"me=s-1 end="^[^ #]"me=s-1 contains=debcontrolKey,debcontrolEmail,debcontrolVariable,debcontrolComment |
3893 | 74 syn region debcontrolMultiFieldSpell start="^\%(Description\):" skip="^ " end="^$"me=s-1 end="^[^ #]"me=s-1 contains=debcontrolKey,debcontrolEmail,debcontrolVariable,debcontrolComment,@Spell |
7 | 75 |
76 " Associate our matches and regions with pretty colours | |
77 if version >= 508 || !exists("did_debcontrol_syn_inits") | |
78 if version < 508 | |
79 let did_debcontrol_syn_inits = 1 | |
80 command -nargs=+ HiLink hi link <args> | |
81 else | |
82 command -nargs=+ HiLink hi def link <args> | |
83 endif | |
84 | |
85 HiLink debcontrolKey Keyword | |
86 HiLink debcontrolField Normal | |
87 HiLink debcontrolStrictField Error | |
4229 | 88 HiLink debcontrolDeprecatedKey Error |
7 | 89 HiLink debcontrolMultiField Normal |
90 HiLink debcontrolArchitecture Normal | |
2908 | 91 HiLink debcontrolMultiArch Normal |
7 | 92 HiLink debcontrolName Normal |
93 HiLink debcontrolPriority Normal | |
94 HiLink debcontrolSection Normal | |
1624 | 95 HiLink debcontrolPackageType Normal |
7 | 96 HiLink debcontrolVariable Identifier |
97 HiLink debcontrolEmail Identifier | |
1624 | 98 HiLink debcontrolVcsSvn Identifier |
99 HiLink debcontrolVcsCvs Identifier | |
100 HiLink debcontrolVcsGit Identifier | |
101 HiLink debcontrolHTTPUrl Identifier | |
1668 | 102 HiLink debcontrolDmUpload Identifier |
1624 | 103 HiLink debcontrolComment Comment |
7 | 104 HiLink debcontrolElse Special |
105 | |
106 delcommand HiLink | |
107 endif | |
108 | |
109 let b:current_syntax = "debcontrol" | |
110 | |
111 " vim: ts=8 sw=2 |