blob: 6641294a313ad1be1aa547715c6c0b7acb5cba28 [file] [log] [blame]
Bram Moolenaar00a927d2010-05-14 23:24:24 +02001" Vim syntax file
2" Language: Haskell Cabal Build file
3" Maintainer: Vincent Berthoux <twinside@gmail.com>
4" File Types: .cabal
Bram Moolenaardb7c6862010-05-21 16:33:48 +02005" Last Change: 2010 May 18
Bram Moolenaar00a927d2010-05-14 23:24:24 +02006" v1.3: Updated to the last version of cabal
7" Added more highlighting for cabal function, true/false
8" and version number. Also added missing comment highlighting.
9" Cabal known compiler are highlighted too.
10"
11" V1.2: Added cpp-options which was missing. Feature implemented
12" by GHC, found with a GHC warning, but undocumented.
13" Whatever...
14"
15" v1.1: Fixed operator problems and added ftdetect file
16" (thanks to Sebastian Schwarz)
17"
18" v1.0: Cabal syntax in vimball format
19" (thanks to Magnus Therning)
20
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020021" quit when a syntax file was already loaded
22if exists("b:current_syntax")
Bram Moolenaar00a927d2010-05-14 23:24:24 +020023 finish
24endif
25
26syn keyword cabalCategory Library library Executable executable Flag flag
27syn keyword cabalCategory source-repository Source-Repository
28
29syn keyword cabalConditional if else
30syn match cabalOperator "&&\|||\|!\|==\|>=\|<="
31syn keyword cabalFunction os arche impl flag
32syn match cabalComment /--.*$/
33syn match cabalVersion "\d\+\(.\(\d\)\+\)\+"
34
35syn match cabalTruth "\ctrue"
36syn match cabalTruth "\cfalse"
37
38syn match cabalCompiler "\cghc"
39syn match cabalCompiler "\cnhc"
40syn match cabalCompiler "\cyhc"
41syn match cabalCompiler "\chugs"
42syn match cabalCompiler "\chbc"
43syn match cabalCompiler "\chelium"
44syn match cabalCompiler "\cjhc"
45syn match cabalCompiler "\clhc"
46
47
48syn match cabalStatement "\cauthor"
49syn match cabalStatement "\cbranch"
50syn match cabalStatement "\cbug-reports"
51syn match cabalStatement "\cbuild-depends"
52syn match cabalStatement "\cbuild-tools"
53syn match cabalStatement "\cbuild-type"
54syn match cabalStatement "\cbuildable"
55syn match cabalStatement "\cc-sources"
56syn match cabalStatement "\ccabal-version"
57syn match cabalStatement "\ccategory"
58syn match cabalStatement "\ccc-options"
59syn match cabalStatement "\ccopyright"
60syn match cabalStatement "\ccpp-options"
61syn match cabalStatement "\cdata-dir"
62syn match cabalStatement "\cdata-files"
63syn match cabalStatement "\cdefault"
64syn match cabalStatement "\cdescription"
65syn match cabalStatement "\cexecutable"
66syn match cabalStatement "\cexposed-modules"
67syn match cabalStatement "\cexposed"
68syn match cabalStatement "\cextensions"
69syn match cabalStatement "\cextra-lib-dirs"
70syn match cabalStatement "\cextra-libraries"
71syn match cabalStatement "\cextra-source-files"
72syn match cabalStatement "\cextra-tmp-files"
73syn match cabalStatement "\cfor example"
74syn match cabalStatement "\cframeworks"
75syn match cabalStatement "\cghc-options"
76syn match cabalStatement "\cghc-prof-options"
77syn match cabalStatement "\cghc-shared-options"
78syn match cabalStatement "\chomepage"
79syn match cabalStatement "\chs-source-dirs"
80syn match cabalStatement "\chugs-options"
81syn match cabalStatement "\cinclude-dirs"
82syn match cabalStatement "\cincludes"
83syn match cabalStatement "\cinstall-includes"
84syn match cabalStatement "\cld-options"
85syn match cabalStatement "\clicense-file"
86syn match cabalStatement "\clicense"
87syn match cabalStatement "\clocation"
88syn match cabalStatement "\cmain-is"
89syn match cabalStatement "\cmaintainer"
90syn match cabalStatement "\cmodule"
91syn match cabalStatement "\cname"
92syn match cabalStatement "\cnhc98-options"
93syn match cabalStatement "\cother-modules"
94syn match cabalStatement "\cpackage-url"
95syn match cabalStatement "\cpkgconfig-depends"
96syn match cabalStatement "\cstability"
97syn match cabalStatement "\csubdir"
98syn match cabalStatement "\csynopsis"
99syn match cabalStatement "\ctag"
100syn match cabalStatement "\ctested-with"
101syn match cabalStatement "\ctype"
102syn match cabalStatement "\cversion"
103
104" Define the default highlighting.
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200105" Only when an item doesn't have highlighting yet
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200106
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200107hi def link cabalVersion Number
108hi def link cabalTruth Boolean
109hi def link cabalComment Comment
110hi def link cabalStatement Statement
111hi def link cabalCategory Type
112hi def link cabalFunction Function
113hi def link cabalConditional Conditional
114hi def link cabalOperator Operator
115hi def link cabalCompiler Constant
Bram Moolenaar00a927d2010-05-14 23:24:24 +0200116
117let b:current_syntax = "cabal"
118
119" vim: ts=8