summaryrefslogtreecommitdiffstats
path: root/runtime/syntax/goaccess.vim
blob: 4ca8f6d92184ce84264e09dd7c5c523b0ec361d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
" Vim syntax file
" Language: GoAccess configuration
" Maintainer: Adam Monsen <haircut@gmail.com>
" Last Change: 2024 Aug 1
" Remark: see https://goaccess.io/man#configuration
"
" The GoAccess configuration file syntax is line-separated settings. Settings
" are space-separated key value pairs. Comments are any line starting with a
" hash mark.
" Example: https://github.com/allinurl/goaccess/blob/master/config/goaccess.conf
"
" This syntax definition supports todo/fixme highlighting in comments, and
" special (Keyword) highlighting if a setting's value is 'true' or 'false'.
"
" TODO: a value is required, so use extreme highlighting (e.g. bright red
" background) if a setting is missing a value.

if exists("b:current_syntax")
  finish
endif

syn match goaccessSettingName '^[a-z-]\+' nextgroup=goaccessSettingValue
syn match goaccessSettingValue '\s\+.\+$' contains=goaccessKeyword
syn match goaccessComment "^#.*$" contains=goaccessTodo,@Spell
syn keyword goaccessTodo TODO FIXME contained
syn keyword goaccessKeyword true false contained

hi def link goaccessSettingName Type
hi def link goaccessSettingValue String
hi def link goaccessComment Comment
hi def link goaccessTodo Todo
hi def link goaccessKeyword Keyword

let b:current_syntax = "goaccess"