pamconf.vim 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. " Vim syntax file
  2. " Language: pam(8) configuration file
  3. " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
  4. " Latest Revision: 2011-08-03
  5. if exists("b:current_syntax")
  6. finish
  7. endif
  8. let s:cpo_save = &cpo
  9. set cpo&vim
  10. syn match pamconfService '^[[:graph:]]\+'
  11. \ nextgroup=pamconfType,
  12. \ pamconfServiceLineCont skipwhite
  13. syn keyword pamconfTodo contained TODO FIXME XXX NOTE
  14. syn region pamconfComment display oneline start='#' end='$'
  15. \ contains=pamconfTodo,@Spell
  16. syn match pamconfServiceLineCont contained '\\$'
  17. \ nextgroup=pamconfType,
  18. \ pamconfServiceLineCont skipwhite skipnl
  19. syn keyword pamconfType account auth password session
  20. \ nextgroup=pamconfControl,
  21. \ pamconfTypeLineCont skipwhite
  22. syn match pamconfTypeLineCont contained '\\$'
  23. \ nextgroup=pamconfControl,
  24. \ pamconfTypeLineCont skipwhite skipnl
  25. syn keyword pamconfControl contained requisite required sufficient
  26. \ optional include substack
  27. \ nextgroup=pamconfMPath,
  28. \ pamconfControlLineContH skipwhite
  29. syn match pamconfControlBegin '\[' nextgroup=pamconfControlValues,
  30. \ pamconfControlLineCont skipwhite
  31. syn match pamconfControlLineCont contained '\\$'
  32. \ nextgroup=pamconfControlValues,
  33. \ pamconfControlLineCont skipwhite skipnl
  34. syn keyword pamconfControlValues contained success open_err symbol_err
  35. \ service_err system_err buf_err
  36. \ perm_denied auth_err cred_insufficient
  37. \ authinfo_unavail user_unknown maxtries
  38. \ new_authtok_reqd acct_expired session_err
  39. \ cred_unavail cred_expired cred_err
  40. \ no_module_data conv_err authtok_err
  41. \ authtok_recover_err authtok_lock_busy
  42. \ authtok_disable_aging try_again ignore
  43. \ abort authtok_expired module_unknown
  44. \ bad_item and default
  45. \ nextgroup=pamconfControlValueEq
  46. syn match pamconfControlValueEq contained '='
  47. \ nextgroup=pamconfControlActionN,
  48. \ pamconfControlAction
  49. syn match pamconfControlActionN contained '\d\+\>'
  50. \ nextgroup=pamconfControlValues,
  51. \ pamconfControlLineCont,pamconfControlEnd
  52. \ skipwhite
  53. syn keyword pamconfControlAction contained ignore bad die ok done reset
  54. \ nextgroup=pamconfControlValues,
  55. \ pamconfControlLineCont,pamconfControlEnd
  56. \ skipwhite
  57. syn match pamconfControlEnd contained '\]'
  58. \ nextgroup=pamconfMPath,
  59. \ pamconfControlLineContH skipwhite
  60. syn match pamconfControlLineContH contained '\\$'
  61. \ nextgroup=pamconfMPath,
  62. \ pamconfControlLineContH skipwhite skipnl
  63. syn match pamconfMPath contained '\S\+'
  64. \ nextgroup=pamconfMPathLineCont,
  65. \ pamconfArgs skipwhite
  66. syn match pamconfArgs contained '\S\+'
  67. \ nextgroup=pamconfArgsLineCont,
  68. \ pamconfArgs skipwhite
  69. syn match pamconfMPathLineCont contained '\\$'
  70. \ nextgroup=pamconfMPathLineCont,
  71. \ pamconfArgs skipwhite skipnl
  72. syn match pamconfArgsLineCont contained '\\$'
  73. \ nextgroup=pamconfArgsLineCont,
  74. \ pamconfArgs skipwhite skipnl
  75. hi def link pamconfTodo Todo
  76. hi def link pamconfComment Comment
  77. hi def link pamconfService Statement
  78. hi def link pamconfServiceLineCont Special
  79. hi def link pamconfType Type
  80. hi def link pamconfTypeLineCont pamconfServiceLineCont
  81. hi def link pamconfControl Macro
  82. hi def link pamconfControlBegin Delimiter
  83. hi def link pamconfControlLineContH pamconfServiceLineCont
  84. hi def link pamconfControlLineCont pamconfServiceLineCont
  85. hi def link pamconfControlValues Identifier
  86. hi def link pamconfControlValueEq Operator
  87. hi def link pamconfControlActionN Number
  88. hi def link pamconfControlAction Identifier
  89. hi def link pamconfControlEnd Delimiter
  90. hi def link pamconfMPath String
  91. hi def link pamconfMPathLineCont pamconfServiceLineCont
  92. hi def link pamconfArgs Normal
  93. hi def link pamconfArgsLineCont pamconfServiceLineCont
  94. let b:current_syntax = "pamconf"
  95. let &cpo = s:cpo_save
  96. unlet s:cpo_save