diff --git a/vim/.vim/filetype.vim b/vim/.vim/filetype.vim index 1fbc41b..94ade89 100644 --- a/vim/.vim/filetype.vim +++ b/vim/.vim/filetype.vim @@ -1 +1,2 @@ au BufNewFile,BufRead known_hosts setfiletype knownhosts +au BufNewFile,BufRead *.conf setfiletype conf diff --git a/vim/.vim/syntax/conf.vim b/vim/.vim/syntax/conf.vim new file mode 100644 index 0000000..fbabcd9 --- /dev/null +++ b/vim/.vim/syntax/conf.vim @@ -0,0 +1,23 @@ +if exists("b:current_syntax") + finish +endif + +syntax clear + +syntax match confSection "[a-zA-Z0-9_]\+" contained +highlight link confSection Statement + +syntax match confKey "[a-zA-Z0-9_]\+\s\+" +highlight link confKey Identifier + +syntax match confValue "[^\n]*" contained +highlight link confValue String + +syntax match confObjectHeader "^\[\[\S+\]\]/$" +syntax match confObjectHeader /\v\[\S+\]/ +highlight link confObjectHeader Type + + +" Enable folding based on sections +setlocal foldmethod=marker +setlocal foldmarker=[,]