nvim-config

Log | Files | Refs | Submodules | README

bip.vim (5704B)


      1 " Vim syntax file
      2 " Language: Bip configuration file
      3 " Copyright: Copyright (C) 2004 Arnaud Cornet and Loïc Gomez
      4 " License: This file is part of the bip project. See the file 'COPYING' for
      5 "          the exact licensing terms.
      6 "
      7 "
      8 " For version 5.x: Clear all syntax items
      9 " For version 6.x: Quit when a syntax file was already loaded
     10 if version < 600
     11   syntax clear
     12 elseif exists("b:current_syntax")
     13   finish
     14 endif
     15 
     16 syn case ignore
     17 
     18 " Global elements
     19 syn match	bipComment	contained %\s*#.*$%
     20 syn match	bipEndError	contained /\(#.*\)\@<![^;{]$/
     21 
     22 " Possible values types.
     23 syn region	bipString	contained start=+"+ end=+"+
     24 syn keyword	bipBool		contained true false
     25 syn match	bipNumeric	contained /\d\d*/
     26 syn region	bipIP		contained start=+"+ end=+"+
     27 		\ contains=bipAddrTk,bipDot
     28 syn region	bipNetmask	contained start=+"+ end=+"+
     29 		\ contains=bipAddrTk,bipDot,bipSlash,bipMask
     30 syn match	bipAddrTk	contained #\d\{1,3}#
     31 syn match	bipDot		contained #\.#
     32 syn match	bipSlash	contained #/#
     33 syn match	bipMask		contained #\d\{1,2}#
     34 syn match	bipWhite	contained +#\@!\s*+
     35 " wrong
     36 " syn match	bipWhite	contained +^\s*\ze[^#]*+
     37 
     38 " Values syntax
     39 syn region	bipStringV	contained matchgroup=Delimiter start=/\s*=\s*/
     40 	\ end=/\s*;\s*/ contains=bipString
     41 syn region	bipBoolV	contained matchgroup=Delimiter start=/\s*=\s*/
     42 	\ end=/\s*;\s*/ contains=bipBool
     43 syn region	bipNumericV	contained matchgroup=Delimiter start=/\s*=\s*/
     44 	\ end=/\s*;\s*/ contains=bipNumeric
     45 syn region	bipIPV		contained matchgroup=Delimiter start=/\s*=\s*/
     46 	\ end=/\s*;\s*/ contains=bipIP
     47 syn region	bipNetmaskV	contained matchgroup=Delimiter start=/\s*=\s*/
     48 	\ end=/\s*;\s*/ contains=bipNetmask
     49 
     50 
     51 syn region	bipMain		start=/\%^/ end=/\%$/
     52 	\ contains=bipKeyword,bipNetwork,bipUser,bipComment,bipEndError
     53 
     54 " Top level elements
     55 syn keyword	bipKeyword	contained nextgroup=bipBoolV client_side_ssl 
     56 	\ log log_system
     57 syn keyword	bipKeyword	contained nextgroup=bipStringV log_root
     58 	\ log_format oidentd_file pid_file client_side_ssl_pem client_side_ciphers
     59 	\ client_side_dh_param ssl_default_ciphers
     60 syn keyword	bipKeyword	contained nextgroup=bipNumericV port log_level
     61 	\ log_sync_interval
     62 syn keyword	bipKeyword	contained nextgroup=bipIPV ip
     63 
     64 " Network block (level 1)
     65 syn region	bipNetwork	contained matchgroup=Macro 
     66 	\ start=/network\s*{\s*/ end=/};/
     67 	\ contains=bipNKeyword,bipServer,bipComment,bipEndError,bipWhite
     68 syn keyword	bipNKeyword	contained nextgroup=bipStringV name ciphers
     69 syn keyword	bipNKeyword	contained nextgroup=bipBoolV ssl
     70 
     71 " User block (level 1)
     72 syn region	bipUser		contained matchgroup=Macro start=/user\s*{\s*/
     73 	\ end=/};/
     74 	\ contains=bipUKeyword,bipConnection,bipComment,bipEndError,bipWhite
     75 syn keyword	bipUKeyword	contained nextgroup=bipStringV password name
     76 	\ default_nick default_user default_realname ssl_check_store
     77 	\ ssl_check_mode ssl_client_certfile
     78 syn keyword	bipUKeyword	contained nextgroup=bipNumericV backlog_lines 
     79 syn keyword	bipUKeyword	contained nextgroup=bipBoolV admin
     80 " DEPRECATED	\ always_backlog bl_msg_only blreset_on_talk 
     81 	\ backlog_no_timestamp backlog backlog_reset_on_talk
     82 	\ backlog_msg_only backlog_always bip_use_notice
     83 
     84 " Connection block (level 2)
     85 syn region	bipConnection	contained matchgroup=Macro
     86 	\ start=/connection\s*{\s*/ end=/};/
     87 	\ contains=bipCoKeyword,bipChannel,bipComment,bipEndError,bipWhite
     88 syn keyword	bipCoKeyword	contained nextgroup=bipBoolV follow_nick
     89 	\ ignore_first_nick log
     90 syn keyword	bipCoKeyword	contained nextgroup=bipStringV name user nick
     91 	\ network password vhost away_nick on_connect_send realname
     92 	\ no_client_away_msg ssl_check_mode
     93 syn keyword	bipCoKeyword	contained nextgroup=bipNumericV source_port
     94 
     95 " Channel elements (lvl 2)
     96 syn region	bipChannel	contained matchgroup=Macro
     97 	\ start=/channel\s*{\s*/ end=/};/
     98 	\ contains=bipCKeyword,bipComment,bipEndError,bipWhite
     99 syn keyword	bipCKeyword	contained nextgroup=bipStringV name key
    100 syn keyword	bipCKeyword	contained nextgroup=bipBoolV backlog
    101 
    102 " Server elements (lvl 2)
    103 syn region	bipServer	contained matchgroup=Macro
    104 	\ start=/server\s*{\s*/ end=/};/
    105 	\ contains=bipSKeyword,bipComment,bipEndError,bipWhite
    106 syn keyword	bipSKeyword	contained nextgroup=bipStringV host
    107 syn keyword	bipSKeyword	contained nextgroup=bipNumericV port 
    108 
    109 " Client elements (lvl 2)
    110 "syn region	bipClient	contained matchgroup=Macro
    111 "	\ start=/client\s*{\s*/ end=/};/
    112 "	\ contains=bipCLKeyword,bipComment,bipEndError,bipWhite
    113 "syn keyword	bipCLKeyword	contained nextgroup=bipStringV user password
    114 
    115 " Synchronization
    116 syn sync match bipSyncNet grouphere bipNetwork /\_.\s*\(network\s*{\)\@=+/
    117 syn sync match bipSyncUser grouphere bipUser /\_.\s*\(user\s*{\)\@=+/
    118 
    119 " Define the default highlighting.
    120 " For version 5.7 and earlier: only when not done already
    121 " For version 5.8 and later: only when an item doesn't have highlighting yet
    122 if version < 508
    123 	command -nargs=+ HiLink hi link <args>
    124 else
    125 	command -nargs=+ HiLink hi def link <args>
    126 endif
    127 
    128 HiLink	bipMain	Error
    129 HiLink	bipNetwork	Error
    130 HiLink	bipChannel	Error
    131 HiLink	bipServer	Error
    132 HiLink	bipUser		Error
    133 HiLink	bipConnection	Error
    134 
    135 " We do not HiLink bipWhite, siec we only want to ignore it.
    136 HiLink	bipKeyword	Keyword
    137 HiLink	bipNKeyword	Keyword
    138 HiLink	bipUKeyword	Keyword
    139 HiLink	bipCKeyword	Keyword
    140 HiLink	bipSKeyword	Keyword
    141 HiLink	bipCoKeyword	Keyword
    142 
    143 HiLink	bipComment	Comment
    144 
    145 HiLink	bipMatch	Include
    146 
    147 HiLink	bipStringV	Error
    148 HiLink	bipBoolV	Error
    149 HiLink	bipNumericV	Error
    150 HiLink	bipIPV	Error
    151 
    152 HiLink	bipEndError	Error
    153 
    154 HiLink	bipString	String
    155 HiLink	bipBool	Boolean
    156 HiLink	bipNumeric	Number
    157 HiLink	bipIP	String
    158 HiLink	bipAddrTk	String
    159 HiLink	bipDot	Delimiter
    160 HiLink	bipSlash	Delimiter
    161 HiLink	bipMask	Number
    162 
    163 delcommand HiLink
    164 
    165 let b:current_syntax = "bip"
    166 " vim: ts=8