From e7f8349a2eec01dda531d93fecb8df920b042d9f Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 2 Aug 2024 20:13:17 +0200 Subject: vim-patch:9.1.0655: filetype: goaccess config file not recognized Problem: filetype: goaccess config file not recognized Solution: detect 'goaccess.conf' as goaccess filetype, also include a basic syntax and ftplugin (Adam Monsen) Add syntax highlighting for GoAccess configuration file. GoAccess is a real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser. GoAccess home page: https://goaccess.io closes: vim/vim#15414 https://github.com/vim/vim/commit/0aa65b48fbe64e18a767b207802483026baecb5d Co-authored-by: Adam Monsen --- runtime/syntax/goaccess.vim | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 runtime/syntax/goaccess.vim (limited to 'runtime/syntax') diff --git a/runtime/syntax/goaccess.vim b/runtime/syntax/goaccess.vim new file mode 100644 index 0000000000..4ca8f6d921 --- /dev/null +++ b/runtime/syntax/goaccess.vim @@ -0,0 +1,34 @@ +" Vim syntax file +" Language: GoAccess configuration +" Maintainer: Adam Monsen +" 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" -- cgit