From a479830f4cd51b3f9ac8279cd17ec83ac474cad8 Mon Sep 17 00:00:00 2001 From: lhark Date: Fri, 1 Feb 2019 15:40:53 -0500 Subject: [PATCH] Marginaly functional syntax HL for fdm.conf files --- vim/after/ftdetect/fdm.vim | 2 ++ vim/after/ftplugin/fdm.vim | 7 ++++ vim/after/syntax/fdm.vim | 65 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 vim/after/ftdetect/fdm.vim create mode 100644 vim/after/ftplugin/fdm.vim create mode 100644 vim/after/syntax/fdm.vim diff --git a/vim/after/ftdetect/fdm.vim b/vim/after/ftdetect/fdm.vim new file mode 100644 index 0000000..eaa669a --- /dev/null +++ b/vim/after/ftdetect/fdm.vim @@ -0,0 +1,2 @@ +" fdm config file " +autocmd BufNewFile,BufRead .fdm.conf,fdm.conf set filetype=fdm diff --git a/vim/after/ftplugin/fdm.vim b/vim/after/ftplugin/fdm.vim new file mode 100644 index 0000000..1ff3cb3 --- /dev/null +++ b/vim/after/ftplugin/fdm.vim @@ -0,0 +1,7 @@ +" fdm config syntax " +setlocal commentstring=#%s +" @-@ adds the literal @ +setlocal iskeyword+=- +setlocal tabstop=4 +setlocal softtabstop=4 +setlocal shiftwidth=4 diff --git a/vim/after/syntax/fdm.vim b/vim/after/syntax/fdm.vim new file mode 100644 index 0000000..cc4260f --- /dev/null +++ b/vim/after/syntax/fdm.vim @@ -0,0 +1,65 @@ +" quit when a syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +" fdm config syntax " +syntax keyword fdmTodos TODO XXX FIXME NOTE +syntax match fdmComments "#.*$" + +" keywords " +syntax keyword fdmCommands include cache match +syntax keyword fdmCommands set nextgroup=fdmOptions skipwhite +syntax keyword fdmCommands account nextgroup=fdmAccountName skipwhite +syntax keyword fdmCommands action nextgroup=fdmActionName skipwhite +syntax keyword fdmAction contained drop keep tag maildir mbox exec pipe write rewrite add-header remove-header remove-headers stdout add-to-cache remove-from-cache action +syntax keyword fdmAction contained smtp skipwhite nextgroup=fdmSourceType +syntax region fdmAccountName start='"' end='"' contained skipwhite nextgroup=fdmAccountTypes +syntax region fdmActionName start='"' end='"' contained skipwhite nextgroup=fdmAction +syntax region fdmString start='"' end='"' +syntax keyword fdmOptions contained maximum-size delete-oversized queue-high queue-low ignore-errors allow-multiple lock-file lock-timeout lock-wait command-user default-user lookup-order lock-types proxy unmatched-mail purge-after no-received no-create file-umask file-group timeout verify-certificates +syntax keyword fdmAccountTypes contained maildir stdin maildirs mbox path mboxes +syntax keyword fdmAccountTypes contained pop3 pop3s imap imaps nntp nntps skipwhite nextgroup=fdmAccountSource +syntax keyword fdmSourceType contained server pipe + + +" Default highlighting +if version >= 508 || !exists("did_fdm_syntax_inits") + if version < 508 + let did_fdm_syntax_inits = 1 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif + HiLink fdmComments Comment + HiLink fdmCommands Type + HiLink fdmOptions Identifier + HiLink fdmAccountTypes SpecialChar + HiLink fdmAccountName String + HiLink fdmActionName String + HiLink fdmString String + HiLink fdmSourceType PreProc + HiLink fdmAction Statement + "HiLink hlslProfile hlslStatement + "HiLink hlslStateGroupArg hlslStatement + "HiLink hlslStateGroupVal Number + "HiLink hlslStatement Statement + "HiLink hlslType Type + "HiLink hlslTypeDeprec WarningMsg + "HiLink hlslStorageClass StorageClass + "HiLink hlslSemantic PreProc + "HiLink hlslFunc hlslStatement + "HiLink hlslLayoutQual hlslFunc + "HiLink hlslAnnotation PreProc + "HiLink hlslStructure Structure + "HiLink hlslSwizzle SpecialChar + "HiLink hlslAttribute Statement + + "HiLink hlslEffectGroup Type + "HiLink hlslEffectFunc Statement + delcommand HiLink +endif + +let b:current_syntax = "fdm" + +