Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: Haskell Cabal Build file |
| 3 | " Maintainer: Vincent Berthoux <twinside@gmail.com> |
| 4 | " File Types: .cabal |
Bram Moolenaar | db7c686 | 2010-05-21 16:33:48 +0200 | [diff] [blame] | 5 | " Last Change: 2010 May 18 |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 6 | " 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 Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 21 | " quit when a syntax file was already loaded |
| 22 | if exists("b:current_syntax") |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 23 | finish |
| 24 | endif |
| 25 | |
| 26 | syn keyword cabalCategory Library library Executable executable Flag flag |
| 27 | syn keyword cabalCategory source-repository Source-Repository |
| 28 | |
| 29 | syn keyword cabalConditional if else |
| 30 | syn match cabalOperator "&&\|||\|!\|==\|>=\|<=" |
| 31 | syn keyword cabalFunction os arche impl flag |
| 32 | syn match cabalComment /--.*$/ |
| 33 | syn match cabalVersion "\d\+\(.\(\d\)\+\)\+" |
| 34 | |
| 35 | syn match cabalTruth "\ctrue" |
| 36 | syn match cabalTruth "\cfalse" |
| 37 | |
| 38 | syn match cabalCompiler "\cghc" |
| 39 | syn match cabalCompiler "\cnhc" |
| 40 | syn match cabalCompiler "\cyhc" |
| 41 | syn match cabalCompiler "\chugs" |
| 42 | syn match cabalCompiler "\chbc" |
| 43 | syn match cabalCompiler "\chelium" |
| 44 | syn match cabalCompiler "\cjhc" |
| 45 | syn match cabalCompiler "\clhc" |
| 46 | |
| 47 | |
| 48 | syn match cabalStatement "\cauthor" |
| 49 | syn match cabalStatement "\cbranch" |
| 50 | syn match cabalStatement "\cbug-reports" |
| 51 | syn match cabalStatement "\cbuild-depends" |
| 52 | syn match cabalStatement "\cbuild-tools" |
| 53 | syn match cabalStatement "\cbuild-type" |
| 54 | syn match cabalStatement "\cbuildable" |
| 55 | syn match cabalStatement "\cc-sources" |
| 56 | syn match cabalStatement "\ccabal-version" |
| 57 | syn match cabalStatement "\ccategory" |
| 58 | syn match cabalStatement "\ccc-options" |
| 59 | syn match cabalStatement "\ccopyright" |
| 60 | syn match cabalStatement "\ccpp-options" |
| 61 | syn match cabalStatement "\cdata-dir" |
| 62 | syn match cabalStatement "\cdata-files" |
| 63 | syn match cabalStatement "\cdefault" |
| 64 | syn match cabalStatement "\cdescription" |
| 65 | syn match cabalStatement "\cexecutable" |
| 66 | syn match cabalStatement "\cexposed-modules" |
| 67 | syn match cabalStatement "\cexposed" |
| 68 | syn match cabalStatement "\cextensions" |
| 69 | syn match cabalStatement "\cextra-lib-dirs" |
| 70 | syn match cabalStatement "\cextra-libraries" |
| 71 | syn match cabalStatement "\cextra-source-files" |
| 72 | syn match cabalStatement "\cextra-tmp-files" |
| 73 | syn match cabalStatement "\cfor example" |
| 74 | syn match cabalStatement "\cframeworks" |
| 75 | syn match cabalStatement "\cghc-options" |
| 76 | syn match cabalStatement "\cghc-prof-options" |
| 77 | syn match cabalStatement "\cghc-shared-options" |
| 78 | syn match cabalStatement "\chomepage" |
| 79 | syn match cabalStatement "\chs-source-dirs" |
| 80 | syn match cabalStatement "\chugs-options" |
| 81 | syn match cabalStatement "\cinclude-dirs" |
| 82 | syn match cabalStatement "\cincludes" |
| 83 | syn match cabalStatement "\cinstall-includes" |
| 84 | syn match cabalStatement "\cld-options" |
| 85 | syn match cabalStatement "\clicense-file" |
| 86 | syn match cabalStatement "\clicense" |
| 87 | syn match cabalStatement "\clocation" |
| 88 | syn match cabalStatement "\cmain-is" |
| 89 | syn match cabalStatement "\cmaintainer" |
| 90 | syn match cabalStatement "\cmodule" |
| 91 | syn match cabalStatement "\cname" |
| 92 | syn match cabalStatement "\cnhc98-options" |
| 93 | syn match cabalStatement "\cother-modules" |
| 94 | syn match cabalStatement "\cpackage-url" |
| 95 | syn match cabalStatement "\cpkgconfig-depends" |
| 96 | syn match cabalStatement "\cstability" |
| 97 | syn match cabalStatement "\csubdir" |
| 98 | syn match cabalStatement "\csynopsis" |
| 99 | syn match cabalStatement "\ctag" |
| 100 | syn match cabalStatement "\ctested-with" |
| 101 | syn match cabalStatement "\ctype" |
| 102 | syn match cabalStatement "\cversion" |
| 103 | |
| 104 | " Define the default highlighting. |
Bram Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 105 | " Only when an item doesn't have highlighting yet |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 106 | |
Bram Moolenaar | f37506f | 2016-08-31 22:22:10 +0200 | [diff] [blame] | 107 | hi def link cabalVersion Number |
| 108 | hi def link cabalTruth Boolean |
| 109 | hi def link cabalComment Comment |
| 110 | hi def link cabalStatement Statement |
| 111 | hi def link cabalCategory Type |
| 112 | hi def link cabalFunction Function |
| 113 | hi def link cabalConditional Conditional |
| 114 | hi def link cabalOperator Operator |
| 115 | hi def link cabalCompiler Constant |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 116 | |
| 117 | let b:current_syntax = "cabal" |
| 118 | |
| 119 | " vim: ts=8 |