From 7ebf9126bcbe10769b2275056fede56736890b59 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Mon, 20 Jan 2020 11:56:31 +0100 Subject: Syntax files ready and tested --- ftdetect/univention-template.vim | 11 +++++++++++ ftplugin/univention-template.vim | 4 ++++ syntax/univention-template.vim | 31 +++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 ftdetect/univention-template.vim create mode 100644 ftplugin/univention-template.vim create mode 100644 syntax/univention-template.vim diff --git a/ftdetect/univention-template.vim b/ftdetect/univention-template.vim new file mode 100644 index 0000000..add6348 --- /dev/null +++ b/ftdetect/univention-template.vim @@ -0,0 +1,11 @@ +au BufRead,BufNewFile */base/univention* set ft=univention-template +au BufRead,BufNewFile */services/univention* set ft=univention-template +au BufRead,BufNewFile */container/univention* set ft=univention-template +au BufRead,BufNewFile */virtualization/univention* set ft=univention-template +au BufRead,BufNewFile */management/univention* set ft=univention-template +au BufRead,BufNewFile */packaging/univention* set ft=univention-template +au BufRead,BufNewFile */mail/univention* set ft=univention-template +au BufRead,BufNewFile */saml/univention* set ft=univention-template +au BufRead,BufNewFile */nagios/univention* set ft=univention-template +au BufRead,BufNewFile /etc/univention/* set ft=univention-template + diff --git a/ftplugin/univention-template.vim b/ftplugin/univention-template.vim new file mode 100644 index 0000000..9071bcd --- /dev/null +++ b/ftplugin/univention-template.vim @@ -0,0 +1,4 @@ +setlocal foldtext=getline(v:foldstart).printf('\ [%d\ lines]\ \ \ \',\ v:foldend-v:foldstart) +setlocal foldmethod=syntax +setlocal foldenable + diff --git a/syntax/univention-template.vim b/syntax/univention-template.vim new file mode 100644 index 0000000..f628762 --- /dev/null +++ b/syntax/univention-template.vim @@ -0,0 +1,31 @@ +" Vim syntax file +" Language: conf.python +" Maintainer: Max Christian Pohle +" Last Change: Jan 20, 2020 + +if exists("b:current_syntax") + finish +end + +let b:current_syntax = "univention-template" + +" embolden normal text to make it a little bit more present than normal python +highlight! Normal cterm=bold gui=bold + +" highlighting for univention config registry +syntax region Define matchgroup=Statement start=/@%@/ end=/@%@/ oneline + +unlet b:current_syntax +syntax include @PYTHON syntax/python.vim +syntax region inlinePython + \ matchgroup=Statement + \ start="@!@" end="@!@.*" + \ contains=@PYTHON + \ keepend fold extend +let b:current_syntax = "univention-template" + +syntax match Operator '[=;]' + +" TODO: further evaluation of: +" syntax region String start=/"/ end=/"/ +" syntax keyword Statement include -- cgit v1.2.3