annotate runtime/syntax/spec.vim @ 27:a01d8d9b2a58 first-working-version

first working version.
author kono
date Mon, 27 Oct 2008 18:28:11 +0900
parents 76efa0be13f1
children c16898406ff2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
1 " Filename: spec.vim
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
2 " Purpose: Vim syntax file
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
3 " Language: SPEC: Build/install scripts for Linux RPM packages
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
4 " Maintainer: Donovan Rebbechi elflord@pegasus.rutgers.edu
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
5 " URL: http://pegasus.rutgers.edu/~elflord/vim/syntax/spec.vim
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
6 " Last Change: Fri Dec 3 11:54 EST 2004 Marcin Dalecki
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
7
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
8 " For version 5.x: Clear all syntax items
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
9 " For version 6.x: Quit when a syntax file was already loaded
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
10 if version < 600
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
11 syntax clear
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
12 elseif exists("b:current_syntax")
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
13 finish
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
14 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
15
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
16 syn sync minlines=1000
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
17
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
18 syn match specSpecialChar contained '[][!$()\\|>^;:{}]'
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
19 syn match specColon contained ':'
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
20 syn match specPercent contained '%'
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
21
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
22 syn match specVariables contained '\$\h\w*' contains=specSpecialVariablesNames,specSpecialChar
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
23 syn match specVariables contained '\${\w*}' contains=specSpecialVariablesNames,specSpecialChar
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
24
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
25 syn match specMacroIdentifier contained '%\h\w*' contains=specMacroNameLocal,specMacroNameOther,specPercent
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
26 syn match specMacroIdentifier contained '%{\w*}' contains=specMacroNameLocal,specMacroNameOther,specPercent,specSpecialChar
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
27
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
28 syn match specSpecialVariables contained '\$[0-9]\|\${[0-9]}'
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
29 syn match specCommandOpts contained '\s\(-\w\+\|--\w[a-zA-Z_-]\+\)'ms=s+1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
30 syn match specComment '^\s*#.*$'
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
31
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
32
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
33 syn case match
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
34
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
35
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
36 "matches with no highlight
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
37 syn match specNoNumberHilite 'X11\|X11R6\|[a-zA-Z]*\.\d\|[a-zA-Z][-/]\d'
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
38 syn match specManpageFile '[a-zA-Z]\.1'
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
39
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
40 "Day, Month and most used license acronyms
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
41 syn keyword specLicense contained GPL LGPL BSD MIT GNU
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
42 syn keyword specWeekday contained Mon Tue Wed Thu Fri Sat Sun
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
43 syn keyword specMonth contained Jan Feb Mar Apr Jun Jul Aug Sep Oct Nov Dec
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
44 syn keyword specMonth contained January February March April May June July August September October November December
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
45
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
46 "#, @, www
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
47 syn match specNumber '\(^-\=\|[ \t]-\=\|-\)[0-9.-]*[0-9]'
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
48 syn match specEmail contained "<\=\<[A-Za-z0-9_.-]\+@\([A-Za-z0-9_-]\+\.\)\+[A-Za-z]\+\>>\="
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
49 syn match specURL contained '\<\(\(https\{0,1}\|ftp\)://\|\(www[23]\{0,1}\.\|ftp\.\)\)[A-Za-z0-9._/~:,#-]\+\>'
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
50 syn match specURLMacro contained '\<\(\(https\{0,1}\|ftp\)://\|\(www[23]\{0,1}\.\|ftp\.\)\)[A-Za-z0-9._/~:,#%{}-]\+\>' contains=specMacroIdentifier
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
51
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
52 "TODO take specSpecialVariables out of the cluster for the sh* contains (ALLBUT)
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
53 "Special system directories
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
54 syn match specListedFilesPrefix contained '/\(usr\|local\|opt\|X11R6\|X11\)/'me=e-1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
55 syn match specListedFilesBin contained '/s\=bin/'me=e-1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
56 syn match specListedFilesLib contained '/\(lib\|include\)/'me=e-1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
57 syn match specListedFilesDoc contained '/\(man\d*\|doc\|info\)\>'
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
58 syn match specListedFilesEtc contained '/etc/'me=e-1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
59 syn match specListedFilesShare contained '/share/'me=e-1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
60 syn cluster specListedFiles contains=specListedFilesBin,specListedFilesLib,specListedFilesDoc,specListedFilesEtc,specListedFilesShare,specListedFilesPrefix,specVariables,specSpecialChar
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
61
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
62 "specComands
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
63 syn match specConfigure contained '\./configure'
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
64 syn match specTarCommand contained '\<tar\s\+[cxvpzIf]\{,5}\s*'
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
65 syn keyword specCommandSpecial contained root
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
66 syn keyword specCommand contained make xmkmf mkdir chmod ln find sed rm strip moc echo grep ls rm mv mkdir install cp pwd cat tail then else elif cd gzip rmdir ln eval export touch
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
67 syn cluster specCommands contains=specCommand,specTarCommand,specConfigure,specCommandSpecial
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
68
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
69 "frequently used rpm env vars
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
70 syn keyword specSpecialVariablesNames contained RPM_BUILD_ROOT RPM_BUILD_DIR RPM_SOURCE_DIR RPM_OPT_FLAGS LDFLAGS CC CC_FLAGS CPPNAME CFLAGS CXX CXXFLAGS CPPFLAGS
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
71
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
72 "valid macro names from /usr/lib/rpm/macros
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
73 syn keyword specMacroNameOther contained buildroot buildsubdir distribution disturl ix86 name nil optflags perl_sitearch release requires_eq vendor version
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
74 syn match specMacroNameOther contained '\<\(PATCH\|SOURCE\)\d*\>'
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
75
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
76 "valid _macro names from /usr/lib/rpm/macros
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
77 syn keyword specMacroNameLocal contained _arch _binary_payload _bindir _build _build_alias _build_cpu _builddir _build_os _buildshell _buildsubdir _build_vendor _bzip2bin _datadir _dbpath _dbpath_rebuild _defaultdocdir _docdir _excludedocs _exec_prefix _fixgroup _fixowner _fixperms _ftpport _ftpproxy _gpg_path _gzipbin _host _host_alias _host_cpu _host_os _host_vendor _httpport _httpproxy _includedir _infodir _install_langs _install_script_path _instchangelog _langpatt _lib _libdir _libexecdir _localstatedir _mandir _netsharedpath _oldincludedir _os _pgpbin _pgp_path _prefix _preScriptEnvironment _provides _rpmdir _rpmfilename _sbindir _sharedstatedir _signature _sourcedir _source_payload _specdir _srcrpmdir _sysconfdir _target _target_alias _target_cpu _target_os _target_platform _target_vendor _timecheck _tmppath _topdir _usr _usrsrc _var _vendor
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
78
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
79
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
80 "------------------------------------------------------------------------------
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
81 " here's is all the spec sections definitions: PreAmble, Description, Package,
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
82 " Scripts, Files and Changelog
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
83
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
84 "One line macros - valid in all ScriptAreas
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
85 "tip: remember do include new items on specScriptArea's skip section
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
86 syn region specSectionMacroArea oneline matchgroup=specSectionMacro start='^%\(define\|patch\d*\|setup\|configure\|GNUconfigure\|find_lang\|makeinstall\|include\)\>' end='$' contains=specCommandOpts,specMacroIdentifier
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
87 syn region specSectionMacroBracketArea oneline matchgroup=specSectionMacro start='^%{\(configure\|GNUconfigure\|find_lang\|makeinstall\)}' end='$' contains=specCommandOpts,specMacroIdentifier
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
88
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
89 "%% Files Section %%
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
90 "TODO %config valid parameters: missingok\|noreplace
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
91 "TODO %verify valid parameters: \(not\)\= \(md5\|atime\|...\)
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
92 syn region specFilesArea matchgroup=specSection start='^%[Ff][Ii][Ll][Ee][Ss]\>' skip='%\(attrib\|defattr\|attr\|dir\|config\|docdir\|doc\|lang\|verify\|ghost\)\>' end='^%[a-zA-Z]'me=e-2 contains=specFilesOpts,specFilesDirective,@specListedFiles,specComment,specCommandSpecial,specMacroIdentifier
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
93 "tip: remember to include new itens in specFilesArea above
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
94 syn match specFilesDirective contained '%\(attrib\|defattr\|attr\|dir\|config\|docdir\|doc\|lang\|verify\|ghost\)\>'
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
95
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
96 "valid options for certain section headers
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
97 syn match specDescriptionOpts contained '\s-[ln]\s*\a'ms=s+1,me=e-1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
98 syn match specPackageOpts contained '\s-n\s*\w'ms=s+1,me=e-1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
99 syn match specFilesOpts contained '\s-f\s*\w'ms=s+1,me=e-1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
100
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
101
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
102 syn case ignore
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
103
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
104
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
105 "%% PreAmble Section %%
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
106 "Copyright and Serial were deprecated by License and Epoch
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
107 syn region specPreAmbleDeprecated oneline matchgroup=specError start='^\(Copyright\|Serial\)' end='$' contains=specEmail,specURL,specURLMacro,specLicense,specColon,specVariables,specSpecialChar,specMacroIdentifier
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
108 syn region specPreAmble oneline matchgroup=specCommand start='^\(Prereq\|Summary\|Name\|Version\|Packager\|Requires\|Icon\|URL\|Source\d*\|Patch\d*\|Prefix\|Packager\|Group\|License\|Release\|BuildRoot\|Distribution\|Vendor\|Provides\|ExclusiveArch\|ExcludeArch\|ExclusiveOS\|Obsoletes\|BuildArch\|BuildArchitectures\|BuildRequires\|BuildConflicts\|BuildPreReq\|Conflicts\|AutoRequires\|AutoReq\|AutoReqProv\|AutoProv\|Epoch\)' end='$' contains=specEmail,specURL,specURLMacro,specLicense,specColon,specVariables,specSpecialChar,specMacroIdentifier
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
109
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
110 "%% Description Section %%
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
111 syn region specDescriptionArea matchgroup=specSection start='^%description' end='^%'me=e-1 contains=specDescriptionOpts,specEmail,specURL,specNumber,specMacroIdentifier,specComment
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
112
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
113 "%% Package Section %%
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
114 syn region specPackageArea matchgroup=specSection start='^%package' end='^%'me=e-1 contains=specPackageOpts,specPreAmble,specComment
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
115
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
116 "%% Scripts Section %%
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
117 syn region specScriptArea matchgroup=specSection start='^%\(prep\|build\|install\|clean\|pre\|postun\|preun\|post\)\>' skip='^%{\|^%\(define\|patch\d*\|configure\|GNUconfigure\|setup\|find_lang\|makeinstall\)\>' end='^%'me=e-1 contains=specSpecialVariables,specVariables,@specCommands,specVariables,shDo,shFor,shCaseEsac,specNoNumberHilite,specCommandOpts,shComment,shIf,specSpecialChar,specMacroIdentifier,specSectionMacroArea,specSectionMacroBracketArea,shOperator,shQuote1,shQuote2
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
118
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
119 "%% Changelog Section %%
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
120 syn region specChangelogArea matchgroup=specSection start='^%changelog' end='^%'me=e-1 contains=specEmail,specURL,specWeekday,specMonth,specNumber,specComment,specLicense
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
121
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
122
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
123
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
124 "------------------------------------------------------------------------------
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
125 "here's the shell syntax for all the Script Sections
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
126
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
127
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
128 syn case match
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
129
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
130
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
131 "sh-like comment stile, only valid in script part
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
132 syn match shComment contained '#.*$'
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
133
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
134 syn region shQuote1 contained matchgroup=shQuoteDelim start=+'+ skip=+\\'+ end=+'+ contains=specMacroIdentifier
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
135 syn region shQuote2 contained matchgroup=shQuoteDelim start=+"+ skip=+\\"+ end=+"+ contains=specVariables,specMacroIdentifier
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
136
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
137 syn match shOperator contained '[><|!&;]\|[!=]='
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
138 syn region shDo transparent matchgroup=specBlock start="\<do\>" end="\<done\>" contains=ALLBUT,shFunction,shDoError,shCase,specPreAmble,@specListedFiles
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
139
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
140 syn region specIf matchgroup=specBlock start="%ifosf\|%ifos\|%ifnos\|%ifarch\|%ifnarch\|%else" end='%endif' contains=ALLBUT, specIfError, shCase
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
141
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
142 syn region shIf transparent matchgroup=specBlock start="\<if\>" end="\<fi\>" contains=ALLBUT,shFunction,shIfError,shCase,@specListedFiles
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
143
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
144 syn region shFor matchgroup=specBlock start="\<for\>" end="\<in\>" contains=ALLBUT,shFunction,shInError,shCase,@specListedFiles
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
145
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
146 syn region shCaseEsac transparent matchgroup=specBlock start="\<case\>" matchgroup=NONE end="\<in\>"me=s-1 contains=ALLBUT,shFunction,shCaseError,@specListedFiles nextgroup=shCaseEsac
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
147 syn region shCaseEsac matchgroup=specBlock start="\<in\>" end="\<esac\>" contains=ALLBUT,shFunction,shCaseError,@specListedFilesBin
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
148 syn region shCase matchgroup=specBlock contained start=")" end=";;" contains=ALLBUT,shFunction,shCaseError,shCase,@specListedFiles
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
149
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
150 syn sync match shDoSync grouphere shDo "\<do\>"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
151 syn sync match shDoSync groupthere shDo "\<done\>"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
152 syn sync match shIfSync grouphere shIf "\<if\>"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
153 syn sync match shIfSync groupthere shIf "\<fi\>"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
154 syn sync match specIfSync grouphere specIf "%ifarch\|%ifos\|%ifnos"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
155 syn sync match specIfSync groupthere specIf "%endIf"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
156 syn sync match shForSync grouphere shFor "\<for\>"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
157 syn sync match shForSync groupthere shFor "\<in\>"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
158 syn sync match shCaseEsacSync grouphere shCaseEsac "\<case\>"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
159 syn sync match shCaseEsacSync groupthere shCaseEsac "\<esac\>"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
160
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
161 " Define the default highlighting.
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
162 " For version 5.7 and earlier: only when not done already
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
163 " For version 5.8 and later: only when an item doesn't have highlighting yet
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
164 if version >= 508 || !exists("did_spec_syntax_inits")
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
165 if version < 508
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
166 let did_spec_syntax_inits = 1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
167 command -nargs=+ HiLink hi link <args>
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
168 else
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
169 command -nargs=+ HiLink hi def link <args>
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
170 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
171
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
172 "main types color definitions
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
173 HiLink specSection Structure
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
174 HiLink specSectionMacro Macro
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
175 HiLink specWWWlink PreProc
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
176 HiLink specOpts Operator
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
177
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
178 "yes, it's ugly, but white is sooo cool
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
179 if &background == "dark"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
180 hi def specGlobalMacro ctermfg=white
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
181 else
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
182 HiLink specGlobalMacro Identifier
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
183 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
184
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
185 "sh colors
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
186 HiLink shComment Comment
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
187 HiLink shIf Statement
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
188 HiLink shOperator Special
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
189 HiLink shQuote1 String
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
190 HiLink shQuote2 String
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
191 HiLink shQuoteDelim Statement
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
192
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
193 "spec colors
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
194 HiLink specBlock Function
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
195 HiLink specColon Special
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
196 HiLink specCommand Statement
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
197 HiLink specCommandOpts specOpts
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
198 HiLink specCommandSpecial Special
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
199 HiLink specComment Comment
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
200 HiLink specConfigure specCommand
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
201 HiLink specDate String
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
202 HiLink specDescriptionOpts specOpts
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
203 HiLink specEmail specWWWlink
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
204 HiLink specError Error
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
205 HiLink specFilesDirective specSectionMacro
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
206 HiLink specFilesOpts specOpts
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
207 HiLink specLicense String
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
208 HiLink specMacroNameLocal specGlobalMacro
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
209 HiLink specMacroNameOther specGlobalMacro
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
210 HiLink specManpageFile NONE
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
211 HiLink specMonth specDate
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
212 HiLink specNoNumberHilite NONE
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
213 HiLink specNumber Number
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
214 HiLink specPackageOpts specOpts
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
215 HiLink specPercent Special
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
216 HiLink specSpecialChar Special
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
217 HiLink specSpecialVariables specGlobalMacro
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
218 HiLink specSpecialVariablesNames specGlobalMacro
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
219 HiLink specTarCommand specCommand
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
220 HiLink specURL specWWWlink
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
221 HiLink specURLMacro specWWWlink
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
222 HiLink specVariables Identifier
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
223 HiLink specWeekday specDate
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
224 HiLink specListedFilesBin Statement
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
225 HiLink specListedFilesDoc Statement
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
226 HiLink specListedFilesEtc Statement
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
227 HiLink specListedFilesLib Statement
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
228 HiLink specListedFilesPrefix Statement
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
229 HiLink specListedFilesShare Statement
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
230
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
231 delcommand HiLink
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
232 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
233
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
234 let b:current_syntax = "spec"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
235
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
236 " vim: ts=8