commit 1a115616cb276d48b468e6c647beef116ade36a9 from: Anna “CyberTailor” via: Omar Polo date: Sun Jul 11 12:27:31 2021 UTC add simple vim syntax file commit - 8068d2ff33992fcaf0e5f38bc7b3d86789e7e92e commit + 1a115616cb276d48b468e6c647beef116ade36a9 blob - /dev/null blob + 1457ba5b6b5c89b1c7259fbdc45956112deecc0e (mode 644) --- /dev/null +++ contrib/README @@ -0,0 +1,6 @@ +This directory is for additional contributed files which may be useful. + +vim + + Syntax highlighting of gmid configuration for vim, to be + placed into ~/.vim/ or /usr/share/vim/vimfiles. blob - /dev/null blob + 2a1290cc985d7ff53a343d7eff4211210dea591d (mode 644) --- /dev/null +++ contrib/vim/ftdetect/gmid.vim @@ -0,0 +1,7 @@ +" Vim filetype detection file +" Language: gmid(1) configuration files +" Licence: ISC + +au BufNewFile,BufRead *.gmid set filetype=gmid +au BufNewFile,BufRead */etc/gmid/* set filetype=gmid +au BufNewFile,BufRead gmid.conf set filetype=gmid blob - /dev/null blob + 07315b44a11aed92ddbc80773b850b4cf62b7c45 (mode 644) --- /dev/null +++ contrib/vim/ftplugin/gmid.vim @@ -0,0 +1,10 @@ +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 +let b:undo_ftplugin = "setl cms< sua<" + +setlocal suffixesadd+=.conf,.gmid + +" vim-commentary support +setlocal commentstring=#\ %s blob - /dev/null blob + ea05ce5208c777a19fc3517d610f70ce1a88064e (mode 644) --- /dev/null +++ contrib/vim/indent/gmid.vim @@ -0,0 +1,11 @@ +if exists("b:did_indent") + finish +endif +let b:did_indent = 1 + +setlocal indentexpr= + +" cindent actually works for simple file structure +setlocal cindent +" Just make sure that the comments are not reset as defs would be. +setlocal cinkeys-=0# blob - /dev/null blob + 68526cd028052300c06299690d830545e861107c (mode 644) --- /dev/null +++ contrib/vim/syntax/gmid.vim @@ -0,0 +1,92 @@ +" Vim syntax file +" Language: gmid(1) configuration files +" Licence: ISC + +if exists("b:current_syntax") + finish +endif + +" Syntax Definition: {{{1 +" ================== +syn case match +setlocal iskeyword+=- + +" Value Types: {{{2 +" ============ +syn keyword gmidBoolean on +syn keyword gmidBoolean off + +syn match gmidNumber "\<\d\+\>" display + +syn region gmidQuotedString start=+"+ end=+"+ skip=+\\"+ +syn region gmidQuotedString start=+'+ end=+'+ skip=+\\'+ + +syn match gmidVariable "\$\w\w*" display +syn match gmidMacro "@\w\w*" display + +" Errors: {{{2 +" ============ +" TODO: write comprehensive syntax rules so it can be checked with: +" syn match gmidError '.' +syn keyword gmidDirectiveDeprecated mime + +" Comments: {{{2 +" ========= +syn match gmidComment "\s*#.*$" display + +" Global Options: {{{2 +" =============== +syn keyword gmidDirective chroot +syn keyword gmidDirective include +syn keyword gmidDirective ipv6 nextgroup=gmidBoolean skipwhite +syn keyword gmidDirective map +syn keyword gmidDirectiveContinuation to-ext +syn keyword gmidDirective port nextgroup=gmidNumber skipwhite +syn keyword gmidDirective prefork nextgroup=gmidNumber skipwhite +syn keyword gmidDirective protocols +syn keyword gmidDirective user + +" Server Blocks: {{{2 +" ============== +syn region gmidBlock start="{" end="}" fold transparent + +syn keyword gmidDirectiveBlock server +syn keyword gmidDirectiveBlock location + +syn keyword gmidDirective alias +syn match gmidDirective "\" nextgroup=gmidBoolean skipwhite display +syn keyword gmidDirective block +syn keyword gmidDirectiveContinuation return nextgroup=gmidNumber skipwhite +syn keyword gmidDirective cert +syn keyword gmidDirective cgi +syn match gmidDirective "\" display +syn keyword gmidDirective entrypoint +syn keyword gmidDirective fastcgi +syn keyword gmidDirectiveContinuation tcp +syn keyword gmidDirective index +syn keyword gmidDirective key +syn keyword gmidDirective lang +syn keyword gmidDirective log nextgroup=gmidBoolean skipwhite +syn keyword gmidDirective param +syn keyword gmidDirective root +syn match gmidDirective "\" display +syn keyword gmidDirective strip nextgroup=gmidNumber skipwhite + +" Highlighting Settings: {{{1 +" ====================== + +hi def link gmidComment Comment + +hi def link gmidBoolean Boolean +hi def link gmidNumber Number +hi def link gmidQuotedString String + +hi def link gmidVariable Identifier +hi def link gmidMacro Macro + +hi def link gmidDirective Keyword +hi def link gmidDirectiveBlock Function +hi def link gmidDirectiveContinuation Type +hi def link gmidDirectiveDeprecated Error + +let b:current_syntax = "gmid"