" 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 <args>
  else
    command -nargs=+ HiLink hi def link <args>
  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"