codekingpro/portable-devtools
114k
1" Vim syntax file2" Language: OpenWrt Unified Configuration Interface3" Maintainer: Colin Caine <complaints@cmcaine.co.uk>4" Upstream: https://github.com/cmcaine/vim-uci5" Last Change: 2021 Sep 196"7" For more information on uci, see https://openwrt.org/docs/guide-user/base-system/uci8 9if exists("b:current_syntax")10 finish11endif12 13" Fancy zero-width non-capturing look-behind to see what the last word was.14" Would be really nice if there was some less obscure or more efficient way to15" do this.16syntax match uciOptionName '\%(\%(option\|list\)\s\+\)\@<=\S*'17syntax match uciConfigName '\%(\%(package\|config\)\s\+\)\@<=\S*'18syntax keyword uciConfigDec package config nextgroup=uciConfigName skipwhite19syntax keyword uciOptionType option list nextgroup=uciOptionName skipwhite20 21" Standard matches.22syntax match uciComment "#.*$"23syntax region uciString start=+"+ end=+"+ skip=+\\"+24syntax region uciString start=+'+ end=+'+ skip=+\\'+25 26highlight default link uciConfigName Identifier27highlight default link uciOptionName Constant28highlight default link uciConfigDec Statement29highlight default link uciOptionType Type30highlight default link uciComment Comment31highlight default link uciString Normal32 33let b:current_syntax = "uci"34 