diff options
author | Max Christian Pohle | 2020-01-20 11:56:31 +0100 |
---|---|---|
committer | Max Christian Pohle | 2020-01-20 11:56:31 +0100 |
commit | 7ebf9126bcbe10769b2275056fede56736890b59 (patch) | |
tree | fffc4b9fc6e99d955755526f345f02c8843c00b5 | |
parent | 5ffd36adcb5e2aa352609a3d4e005b3e99173442 (diff) | |
download | vim-7ebf9126bcbe10769b2275056fede56736890b59.tar.bz2 vim-7ebf9126bcbe10769b2275056fede56736890b59.zip |
Syntax files ready and tested
-rw-r--r-- | ftdetect/univention-template.vim | 11 | ||||
-rw-r--r-- | ftplugin/univention-template.vim | 4 | ||||
-rw-r--r-- | syntax/univention-template.vim | 31 |
3 files changed, 46 insertions, 0 deletions
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 @@ | |||
1 | au BufRead,BufNewFile */base/univention* set ft=univention-template | ||
2 | au BufRead,BufNewFile */services/univention* set ft=univention-template | ||
3 | au BufRead,BufNewFile */container/univention* set ft=univention-template | ||
4 | au BufRead,BufNewFile */virtualization/univention* set ft=univention-template | ||
5 | au BufRead,BufNewFile */management/univention* set ft=univention-template | ||
6 | au BufRead,BufNewFile */packaging/univention* set ft=univention-template | ||
7 | au BufRead,BufNewFile */mail/univention* set ft=univention-template | ||
8 | au BufRead,BufNewFile */saml/univention* set ft=univention-template | ||
9 | au BufRead,BufNewFile */nagios/univention* set ft=univention-template | ||
10 | au BufRead,BufNewFile /etc/univention/* set ft=univention-template | ||
11 | |||
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 @@ | |||
1 | setlocal foldtext=getline(v:foldstart).printf('\ [%d\ lines]\ \ \ \',\ v:foldend-v:foldstart) | ||
2 | setlocal foldmethod=syntax | ||
3 | setlocal foldenable | ||
4 | |||
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 @@ | |||
1 | " Vim syntax file | ||
2 | " Language: conf.python | ||
3 | " Maintainer: Max Christian Pohle <pohle@univention.de> | ||
4 | " Last Change: Jan 20, 2020 | ||
5 | |||
6 | if exists("b:current_syntax") | ||
7 | finish | ||
8 | end | ||
9 | |||
10 | let b:current_syntax = "univention-template" | ||
11 | |||
12 | " embolden normal text to make it a little bit more present than normal python | ||
13 | highlight! Normal cterm=bold gui=bold | ||
14 | |||
15 | " highlighting for univention config registry | ||
16 | syntax region Define matchgroup=Statement start=/@%@/ end=/@%@/ oneline | ||
17 | |||
18 | unlet b:current_syntax | ||
19 | syntax include @PYTHON syntax/python.vim | ||
20 | syntax region inlinePython | ||
21 | \ matchgroup=Statement | ||
22 | \ start="@!@" end="@!@.*" | ||
23 | \ contains=@PYTHON | ||
24 | \ keepend fold extend | ||
25 | let b:current_syntax = "univention-template" | ||
26 | |||
27 | syntax match Operator '[=;]' | ||
28 | |||
29 | " TODO: further evaluation of: | ||
30 | " syntax region String start=/"/ end=/"/ | ||
31 | " syntax keyword Statement include | ||