robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
07661009c5
master
1" Vim syntax file 2" Language: cmakecache - CMakeCache.txt files generated by CMake 3" Author: bfrg <https://github.com/bfrg> 4" Upstream: https://github.com/bfrg/vim-cmakecache-syntax 5" Last Change: Nov 28, 2019 6" License: Same as Vim itself (see :h license) 7 8if exists ( 'b:current_syntax' ) 9finish 10endif 11 12let s: cpo_save = & cpoptions 13set cpoptions & vim 14 15" Comments start with # or // 16syntax region CMakeCacheComment start = "#\|// "end = "$ " 17 18" Match 'key' in key:type=value 19syntax match CMakeCacheKey "^\s * \w\+\(-ADVANCED\)\=: "me= e-1 20 21" Highlight 'str' in key:STRING=str (many thanks to Nickspoons in #vim!) 22syntax region CMakeCacheStringVar matchgroup = CMakeCacheType start = ":STRING= "ms= s+1, rs= e-1end = "$ "contains = CMakeCacheString keepend 23syntax region CMakeCacheString start = "= "ms= s+1end = "$ "contained 24 25" Highlight boolean 'value' in key:BOOL=value 26syntax region CMakeCacheBoolVar matchgroup = CMakeCacheType start = ":BOOL= "ms= s+1, rs= e-1end = "$ "contains = CMakeCacheBool keepend 27syntax region CMakeCacheBool start = "= "ms= s+1end = "$ "contained 28 29" Highlight 'path' in key:PATH=path 30syntax region CMakeCachePathVar matchgroup = CMakeCacheType start = ":PATH= "ms= s+1, rs= e-1end = "$ "contains = CMakeCachePath keepend 31syntax region CMakeCachePath start = "= "ms= s+1end = "$ "contained 32 33" Highlight 'file' in key:FILEPATH=file 34syntax region CMakeCacheFilePathVar matchgroup = CMakeCacheType start = ":FILEPATH= "ms= s+1, rs= e-1end = "$ "contains = CMakeCacheFilePath keepend 35syntax region CMakeCacheFilePath start = "= "ms= s+1end = "$ "contained 36 37" Highlight 'value' in key:STATIC=value 38syntax region CMakeCacheStaticVar matchgroup = CMakeCacheType start = ":STATIC= "ms= s+1, rs= e-1end = "$ "contains = CMakeCacheStatic keepend 39syntax region CMakeCacheStatic start = "= "ms= s+1end = "$ "contained 40 41" Highlight 'value' in key:Internal=value 42syntax region CMakeCacheInternalVar matchgroup = CMakeCacheType start = ":INTERNAL= "ms= s+1, rs= e-1end = "$ "contains = CMakeCacheInternal keepend 43syntax region CMakeCacheInternal start = "= "ms= s+1end = "$ "contained 44 45hi def link CMakeCacheComment Comment 46hi def link CMakeCacheKey Identifier 47hi def link CMakeCacheString String 48hi def link CMakeCacheBool Constant 49hi def link CMakeCachePath Directory 50hi def link CMakeCacheFilePath Normal 51hi def link CMakeCacheStatic Normal 52hi def link CMakeCacheInternal Normal 53 54" Highlight 'type' in key:type=value 55hi def link CMakeCacheType Type 56 57let b: current_syntax = 'cmakecache' 58 59let & cpoptions = s: cpo_save 60unlet s: cpo_save