neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

denyhosts.vim (7365B)


      1 " Vim syntax file
      2 " Language:             denyhosts configuration file
      3 " Previous Maintainer:  Nikolai Weibull <now@bitwi.se>
      4 " Latest Revision:      2007-06-25
      5 
      6 if exists("b:current_syntax")
      7  finish
      8 endif
      9 
     10 let s:cpo_save = &cpo
     11 set cpo&vim
     12 
     13 syn keyword denyhostsTodo
     14      \ contained
     15      \ TODO
     16      \ FIXME
     17      \ XXX
     18      \ NOTE
     19 
     20 syn case ignore
     21 
     22 syn match   denyhostsComment
     23      \ contained
     24      \ display
     25      \ '#.*'
     26      \ contains=denyhostsTodo,
     27      \          @Spell
     28 
     29 syn match   denyhostsBegin
     30      \ display
     31      \ '^'
     32      \ nextgroup=@denyhostsSetting,
     33      \           denyhostsComment
     34      \ skipwhite
     35 
     36 syn cluster denyhostsSetting
     37      \ contains=denyhostsStringSetting,
     38      \          denyhostsBooleanSetting,
     39      \          denyhostsPathSetting,
     40      \          denyhostsNumericSetting,
     41      \          denyhostsTimespecSetting,
     42      \          denyhostsFormatSetting,
     43      \          denyhostsRegexSetting
     44 
     45 syn keyword denyhostsStringSetting
     46      \ contained
     47      \ ADMIN_EMAIL
     48      \ SMTP_HOST
     49      \ SMTP_USERNAME
     50      \ SMTP_PASSWORD
     51      \ SMTP_FROM
     52      \ SMTP_SUBJECT
     53      \ BLOCK_SERVICE
     54      \ nextgroup=denyhostsStringDelimiter
     55      \ skipwhite
     56 
     57 syn keyword denyhostsBooleanSetting
     58      \ contained
     59      \ SUSPICIOUS_LOGIN_REPORT_ALLOWED_HOSTS
     60      \ HOSTNAME_LOOKUP
     61      \ SYSLOG_REPORT
     62      \ RESET_ON_SUCCESS
     63      \ SYNC_UPLOAD
     64      \ SYNC_DOWNLOAD
     65      \ ALLOWED_HOSTS_HOSTNAME_LOOKUP
     66      \ nextgroup=denyhostsBooleanDelimiter
     67      \ skipwhite
     68 
     69 syn keyword denyhostsPathSetting
     70      \ contained
     71      \ DAEMON_LOG
     72      \ PLUGIN_DENY
     73      \ PLUGIN_PURGE
     74      \ SECURE_LOG
     75      \ LOCK_FILE
     76      \ HOSTS_DENY
     77      \ WORK_DIR
     78      \ nextgroup=denyhostsPathDelimiter
     79      \ skipwhite
     80 
     81 syn keyword denyhostsNumericSetting
     82      \ contained
     83      \ SYNC_DOWNLOAD_THRESHOLD
     84      \ SMTP_PORT
     85      \ PURGE_THRESHOLD
     86      \ DENY_THRESHOLD_INVALID
     87      \ DENY_THRESHOLD_VALID
     88      \ DENY_THRESHOLD_ROOT
     89      \ DENY_THRESHOLD_RESTRICTED
     90      \ nextgroup=denyhostsNumericDelimiter
     91      \ skipwhite
     92 
     93 syn keyword denyhostsTimespecSetting
     94      \ contained
     95      \ DAEMON_SLEEP
     96      \ DAEMON_PURGE
     97      \ AGE_RESET_INVALID
     98      \ AGE_RESET_VALID
     99      \ AGE_RESET_ROOT
    100      \ AGE_RESET_RESTRICTED
    101      \ SYNC_INTERVAL
    102      \ SYNC_DOWNLOAD_RESILIENCY
    103      \ PURGE_DENY
    104      \ nextgroup=denyhostsTimespecDelimiter
    105      \ skipwhite
    106 
    107 syn keyword denyhostsFormatSetting
    108      \ contained
    109      \ DAEMON_LOG_TIME_FORMAT
    110      \ DAEMON_LOG_MESSAGE_FORMAT
    111      \ SMTP_DATE_FORMAT
    112      \ nextgroup=denyhostsFormatDelimiter
    113      \ skipwhite
    114 
    115 syn keyword denyhostsRegexSetting
    116      \ contained
    117      \ SSHD_FORMAT_REGEX
    118      \ FAILED_ENTRY_REGEX
    119      \ FAILED_ENTRY_REGEX2
    120      \ FAILED_ENTRY_REGEX3
    121      \ FAILED_ENTRY_REGEX4
    122      \ FAILED_ENTRY_REGEX5
    123      \ FAILED_ENTRY_REGEX6
    124      \ FAILED_ENTRY_REGEX7
    125      \ USERDEF_FAILED_ENTRY_REGEX
    126      \ SUCCESSFUL_ENTRY_REGEX
    127      \ nextgroup=denyhostsRegexDelimiter
    128      \ skipwhite
    129 
    130 syn keyword denyhostURLSetting
    131      \ contained
    132      \ SYNC_SERVER
    133      \ nextgroup=denyhostsURLDelimiter
    134      \ skipwhite
    135 
    136 syn match   denyhostsStringDelimiter
    137      \ contained
    138      \ display
    139      \ '[:=]'
    140      \ nextgroup=denyhostsString
    141      \ skipwhite
    142 
    143 syn match   denyhostsBooleanDelimiter
    144      \ contained
    145      \ display
    146      \ '[:=]'
    147      \ nextgroup=@denyhostsBoolean
    148      \ skipwhite
    149 
    150 syn match   denyhostsPathDelimiter
    151      \ contained
    152      \ display
    153      \ '[:=]'
    154      \ nextgroup=denyhostsPath
    155      \ skipwhite
    156 
    157 syn match   denyhostsNumericDelimiter
    158      \ contained
    159      \ display
    160      \ '[:=]'
    161      \ nextgroup=denyhostsNumber
    162      \ skipwhite
    163 
    164 syn match   denyhostsTimespecDelimiter
    165      \ contained
    166      \ display
    167      \ '[:=]'
    168      \ nextgroup=denyhostsTimespec
    169      \ skipwhite
    170 
    171 syn match   denyhostsFormatDelimiter
    172      \ contained
    173      \ display
    174      \ '[:=]'
    175      \ nextgroup=denyhostsFormat
    176      \ skipwhite
    177 
    178 syn match   denyhostsRegexDelimiter
    179      \ contained
    180      \ display
    181      \ '[:=]'
    182      \ nextgroup=denyhostsRegex
    183      \ skipwhite
    184 
    185 syn match   denyhostsURLDelimiter
    186      \ contained
    187      \ display
    188      \ '[:=]'
    189      \ nextgroup=denyhostsURL
    190      \ skipwhite
    191 
    192 syn match   denyhostsString
    193      \ contained
    194      \ display
    195      \ '.\+'
    196 
    197 syn cluster denyhostsBoolean
    198      \ contains=denyhostsBooleanTrue,
    199      \          denyhostsBooleanFalse
    200 
    201 syn match   denyhostsBooleanFalse
    202      \ contained
    203      \ display
    204      \ '.\+'
    205 
    206 syn match   denyhostsBooleanTrue
    207      \ contained
    208      \ display
    209      \ '\s*\%(1\|t\%(rue\)\=\|y\%(es\)\=\)\>\s*$'
    210 
    211 syn match   denyhostsPath
    212      \ contained
    213      \ display
    214      \ '.\+'
    215 
    216 syn match   denyhostsNumber
    217      \ contained
    218      \ display
    219      \ '\d\+\>'
    220 
    221 syn match   denyhostsTimespec
    222      \ contained
    223      \ display
    224      \ '\d\+[mhdwy]\>'
    225 
    226 syn match   denyhostsFormat
    227      \ contained
    228      \ display
    229      \ '.\+'
    230      \ contains=denyhostsFormattingExpandos
    231 
    232 syn match   denyhostsFormattingExpandos
    233      \ contained
    234      \ display
    235      \ '%.'
    236 
    237 syn match   denyhostsRegex
    238      \ contained
    239      \ display
    240      \ '.\+'
    241 
    242 " TODO: Perhaps come up with a better regex here?  There should really be a
    243 " library for these kinds of generic regexes, that is, URLs, mail addresses, …
    244 syn match   denyhostsURL
    245      \ contained
    246      \ display
    247      \ '.\+'
    248 
    249 hi def link denyhostsTodo               Todo
    250 hi def link denyhostsComment            Comment
    251 hi def link denyhostsSetting            Keyword
    252 hi def link denyhostsStringSetting      denyhostsSetting
    253 hi def link denyhostsBooleanSetting     denyhostsSetting
    254 hi def link denyhostsPathSetting        denyhostsSetting
    255 hi def link denyhostsNumericSetting     denyhostsSetting
    256 hi def link denyhostsTimespecSetting    denyhostsSetting
    257 hi def link denyhostsFormatSetting      denyhostsSetting
    258 hi def link denyhostsRegexSetting       denyhostsSetting
    259 hi def link denyhostURLSetting          denyhostsSetting
    260 hi def link denyhostsDelimiter          Normal
    261 hi def link denyhostsStringDelimiter    denyhostsDelimiter
    262 hi def link denyhostsBooleanDelimiter   denyhostsDelimiter
    263 hi def link denyhostsPathDelimiter      denyhostsDelimiter
    264 hi def link denyhostsNumericDelimiter   denyhostsDelimiter
    265 hi def link denyhostsTimespecDelimiter  denyhostsDelimiter
    266 hi def link denyhostsFormatDelimiter    denyhostsDelimiter
    267 hi def link denyhostsRegexDelimiter     denyhostsDelimiter
    268 hi def link denyhostsURLDelimiter       denyhostsDelimiter
    269 hi def link denyhostsString             String
    270 if exists('g:syntax_booleans_simple') || exists('b:syntax_booleans_simple')
    271  hi def link denyhostsBoolean          Boolean
    272  hi def link denyhostsBooleanFalse     denyhostsBoolean
    273  hi def link denyhostsBooleanTrue      denyhostsBoolean
    274 else
    275  hi def    denyhostsBooleanTrue        term=bold ctermfg=Green guifg=Green
    276  hi def    denyhostsBooleanFalse       ctermfg=Red guifg=Red
    277 endif
    278 hi def link denyhostsPath               String
    279 hi def link denyhostsNumber             Number
    280 hi def link denyhostsTimespec           Number
    281 hi def link denyhostsFormat             String
    282 hi def link denyhostsFormattingExpandos Special
    283 hi def link denyhostsRegex              String
    284 hi def link denyhostsURL                String
    285 
    286 let b:current_syntax = "denyhosts"
    287 
    288 let &cpo = s:cpo_save
    289 unlet s:cpo_save