2 " Language: Slrn setup file
3 " Maintainer: Preben "Peppe" Guldberg (c928400@student.dtu.dk)
4 " Last Change: Fri Apr 3 11:09:41 1998
6 " For version 5.x: Clear all syntax items
7 " For version 6.x: Quit when a syntax file was already loaded
10 elseif exists("b:current_syntax")
14 syn keyword slrnrcTodo contained Todo
16 " in some places white space is illegal
17 syn match slrnrcSpaceError contained "\s"
19 syn match slrnrcNumber contained "-\=\<\d\+\>"
20 syn match slrnrcNumber contained +'[^']\+'+
22 syn match slrnrcSpecKey contained +\(\\[e"']\|\^[^'"]\)+
24 syn match slrnrcKey contained "\S\+" contains=slrnrcSpecKey
25 syn region slrnrcKey contained start=+"+ skip=+\\"+ end=+"+ oneline contains=slrnrcSpecKey
26 syn region slrnrcKey contained start=+'+ skip=+\\'+ end=+'+ oneline contains=slrnrcSpecKey
28 syn match slrnrcSpecChar contained +'+
29 syn match slrnrcSpecChar contained +\\[n"]+
30 syn match slrnrcSpecChar contained "%[dfmnrs%]"
32 syn match slrnrcString contained /[^ \t%"']\+/ contains=slrnrcSpecChar
33 syn region slrnrcString contained start=+"+ skip=+\\"+ end=+"+ oneline contains=slrnrcSpecChar
35 syn match slangPreCondit "^#ifn\=\(def\>\|false\>\|true\>\|\$\)"
36 syn match slangPreCondit "^#\(elif\|else\|endif\)\>"
38 syn match slrnrcComment "%.*$" contains=slrnrcTodo
40 syn keyword slrnrcVarInt contained author_display beep cc_followup confirm_actions
41 syn keyword slrnrcVarInt contained display_author_realname display_score
42 syn keyword slrnrcVarInt contained group_dsc_start_column kill_score lines_per_update
43 syn keyword slrnrcVarInt contained max_low_score min_high_score mouse
44 syn keyword slrnrcVarInt contained new_subject_breaks_threads no_backups prompt_next_group
45 syn keyword slrnrcVarInt contained query_next_article query_next_group
46 syn keyword slrnrcVarInt contained query_read_group_cutoff query_reconnect read_active
47 syn keyword slrnrcVarInt contained reject_long_lines scroll_by_page show_article
48 syn keyword slrnrcVarInt contained show_descriptions show_thread_subject sorting_method
49 syn keyword slrnrcVarInt contained spoiler_char spoiler_display_mode spool_check_up_on_nov
50 syn keyword slrnrcVarInt contained uncollapse_threads unsubscribe_new_groups
51 syn keyword slrnrcVarInt contained use_header_numbers use_metamail use_mime use_tilde
52 syn keyword slrnrcVarInt contained use_tmpdir use_xgtitle wrap_flags write_newsrc_flags
53 syn keyword slrnrcVarInt contained ignore_signature use_color use_blink use_grouplens
54 syn keyword slrnrcVarInt contained use_inews use_slrnpull grouplens_port
55 " match as a "string" too
56 syn region slrnrcVarIntStr contained matchgroup=slrnrcVarInt start=+"+ end=+"+ oneline contains=slrnrcVarInt,slrnrcSpaceError
58 syn keyword slrnrcVarStr contained Xbrowser art_help_line cc_followup_string charset
59 syn keyword slrnrcVarStr contained custom_headers decode_directory editor_command
60 syn keyword slrnrcVarStr contained followup_custom_headers followup_string group_help_line
61 syn keyword slrnrcVarStr contained grouplens_host grouplens_pseudoname header_help_line
62 syn keyword slrnrcVarStr contained inews_program macro_directory mail_editor_command
63 syn keyword slrnrcVarStr contained metamail_command mime_charset non_Xbrowser organization
64 syn keyword slrnrcVarStr contained post_editor_command post_object postpone_directory
65 syn keyword slrnrcVarStr contained quote_string realname reply_custom_headers reply_string
66 syn keyword slrnrcVarStr contained replyto save_directory save_posts save_replies
67 syn keyword slrnrcVarStr contained score_editor_command sendmail_command server_object
68 syn keyword slrnrcVarStr contained signature spool_active_file spool_activetimes_file
69 syn keyword slrnrcVarStr contained spool_inn_root spool_newsgroups_file spool_nov_file
70 syn keyword slrnrcVarStr contained spool_nov_root spool_root username
72 "syn keyword slrnrcVarStr contained followup
73 " match as a "string" too
74 syn region slrnrcVarStrStr contained matchgroup=slrnrcVarStr start=+"+ end=+"+ oneline contains=slrnrcVarStr,slrnrcSpaceError
77 syn region slrnrcCmdLine matchgroup=slrnrcCmd start="^\s*\(autobaud\|grouplens_add\|hostname\|ignore_quotes\|include\|interpret\|nnrpaccess\|scorefile\|server\)\>" end="$" oneline contains=slrnrc\(String\|Comment\)
80 syn keyword slrnrcSet contained set
81 syn match slrnrcSetStr "^\s*set\s\+\S\+" skipwhite nextgroup=slrnrcString contains=slrnrcSet,slrnrcVarStr\(Str\)\=
82 syn match slrnrcSetInt contained "^\s*set\s\+\S\+" contains=slrnrcSet,slrnrcVarInt\(Str\)\=
83 syn match slrnrcSetIntLine "^\s*set\s\+\S\+\s\+\(-\=\d\+\>\|'[^']\+'\)" contains=slrnrcSetInt,slrnrcNumber,slrnrcVarInt
86 syn keyword slrnrcColorObj contained article author box cursor description error frame
87 syn keyword slrnrcColorObj contained group grouplens_display header_name header_number
88 syn keyword slrnrcColorObj contained headers high_score menu menu_press normal quotes
89 syn keyword slrnrcColorObj contained response_char selection signature status subject
90 syn keyword slrnrcColorObj contained thread_number tilde tree
91 syn region slrnrcColorObjStr contained matchgroup=slrnrcColorObj start=+"+ end=+"+ oneline contains=slrnrcColorObj,slrnrcSpaceError
92 syn keyword slrnrcColorVal contained black red green brown blue magenta cyan lightgray
93 syn keyword slrnrcColorVal contained gray brightred brightgreen yellow brightblue brightmagenta brightcyan white
94 syn region slrnrcColorValStr contained matchgroup=slrnrcColorVal start=+"+ end=+"+ oneline contains=slrnrcColorVal,slrnrcSpaceError
95 " mathcing a function with three arguments
96 syn keyword slrnrcColor contained color
97 syn match slrnrcColorInit contained "^\s*color\s\+\S\+" skipwhite nextgroup=slrnrcColorVal\(Str\)\= contains=slrnrcColor\(Obj\|ObjStr\)\=
98 syn match slrnrcColorLine "^\s*color\s\+\S\+\s\+\S\+" skipwhite nextgroup=slrnrcColorVal\(Str\)\= contains=slrnrcColor\(Init\|Val\|ValStr\)
101 syn keyword slrnrcMonoVal contained blink bold none reverse underline
102 syn region slrnrcMonoValStr contained matchgroup=slrnrcMonoVal start=+"+ end=+"+ oneline contains=slrnrcMonoVal,slrnrcSpaceError
103 " color object is inherited
104 " mono needs at least one argument
105 syn keyword slrnrcMono contained mono
106 syn match slrnrcMonoInit contained "^\s*mono\s\+\S\+" contains=slrnrcMono,slrnrcColorObj\(Str\)\=
107 syn match slrnrcMonoLine "^\s*mono\s\+\S\+\s\+\S.*" contains=slrnrcMono\(Init\|Val\|ValStr\),slrnrcComment
109 " Functions in article mode
110 syn keyword slrnrcFunArt contained art_bob art_eob art_xpunge article_linedn article_lineup
111 syn keyword slrnrcFunArt contained article_pagedn article_pageup article_search
112 syn keyword slrnrcFunArt contained author_search_backward author_search_forward browse_url
113 syn keyword slrnrcFunArt contained cancel catchup catchup_all create_score decode delete
114 syn keyword slrnrcFunArt contained delete_thread digit_arg down enlarge_window exchange_mark
115 syn keyword slrnrcFunArt contained fast_quit followup forward forward_digest
116 syn keyword slrnrcFunArt contained get_children_headers get_parent_header goto_article
117 syn keyword slrnrcFunArt contained goto_beginning goto_end goto_last_read
118 syn keyword slrnrcFunArt contained grouplens_rate_article header_bob header_eob help
119 syn keyword slrnrcFunArt contained hide_article left locate_article locate_header_by_msgid
120 syn keyword slrnrcFunArt contained mark_spot next next_high_score next_same_subject pagedn
121 syn keyword slrnrcFunArt contained pageup pipe_article post post_postponed prev quit redraw
122 syn keyword slrnrcFunArt contained repeat_last_key reply right save scroll_dn scroll_up
123 syn keyword slrnrcFunArt contained show_spoilers shrink_window skip_quotes
124 syn keyword slrnrcFunArt contained skip_to_next_group skip_to_prev_group
125 syn keyword slrnrcFunArt contained subject_search_backward subject_search_forward suspend
126 syn keyword slrnrcFunArt contained tag_header toggle_collapse_threads toggle_header_tag
127 syn keyword slrnrcFunArt contained toggle_headers toggle_quotes toggle_rot13
128 syn keyword slrnrcFunArt contained toggle_show_author toggle_sort uncatchup uncatchup_all
129 syn keyword slrnrcFunArt contained undelete untag_headers up wrap_article
131 " Functions in group mode
132 syn keyword slrnrcFunGroup contained add_group bob catchup digit_arg down eob group_bob
133 syn keyword slrnrcFunGroup contained group_eob group_search group_search_forward help
134 syn keyword slrnrcFunGroup contained move_group pagedown pageup post post_postponed quit
135 syn keyword slrnrcFunGroup contained redraw refresh_groups repeat_last_key save_newsrc
136 syn keyword slrnrcFunGroup contained select_group subscribe suspend toggle_group_display
137 syn keyword slrnrcFunGroup contained toggle_hidden toggle_list_all toggle_scoring
138 syn keyword slrnrcFunGroup contained transpose_groups uncatch_up unsubscribe up
140 " Functions in readline mode (actually from slang's slrline.c)
141 syn keyword slrnrcFunRead contained bdel bol del deleol down enter eol left
142 syn keyword slrnrcFunRead contained quoted_insert right trim up
145 syn keyword slrnrcSetkeyObj contained article group readline
146 syn region slrnrcSetkeyObjStr contained matchgroup=slrnrcSetkeyObj start=+"+ end=+"+ oneline contains=slrnrcSetkeyObj
147 syn match slrnrcSetkeyArt contained '\("\=\)\<article\>\1\s\+\S\+' skipwhite nextgroup=slrnrcKey contains=slrnrcSetKeyObj\(Str\)\=,slrnrcFunArt
148 syn match slrnrcSetkeyGroup contained '\("\=\)\<group\>\1\s\+\S\+' skipwhite nextgroup=slrnrcKey contains=slrnrcSetKeyObj\(Str\)\=,slrnrcFunGroup
149 syn match slrnrcSetkeyRead contained '\("\=\)\<readline\>\1\s\+\S\+' skipwhite nextgroup=slrnrcKey contains=slrnrcSetKeyObj\(Str\)\=,slrnrcFunRead
150 syn match slrnrcSetkey "^\s*setkey\>" skipwhite nextgroup=slrnrcSetkeyArt,slrnrcSetkeyGroup,slrnrcSetkeyRead
153 syn match slrnrcUnsetkey '^\s*unsetkey\s\+\("\)\=\(article\|group\|readline\)\>\1' skipwhite nextgroup=slrnrcKey contains=slrnrcSetkeyObj\(Str\)\=
155 " uncomment these lines and the linking below to get these highlighted
156 "syn keyword slrnrcObsolete ccfollowup_string decode_directory editor_command followup
157 "syn keyword slrnrcObsolete organization quote_string realname replyto signature username
159 " Define the default highlighting.
160 " For version 5.7 and earlier: only when not done already
161 " For version 5.8 and later: only when an item doesn't have highlighting yet
162 if version >= 508 || !exists("did_slrnrc_syntax_inits")
164 let did_slrnrc_syntax_inits = 1
165 command -nargs=+ HiLink hi link <args>
167 command -nargs=+ HiLink hi def link <args>
170 HiLink slrnrcTodo Todo
171 HiLink slrnrcSpaceError Error
172 HiLink slrnrcNumber Number
173 HiLink slrnrcSpecKey SpecialChar
174 HiLink slrnrcKey String
175 HiLink slrnrcSpecChar SpecialChar
176 HiLink slrnrcString String
177 HiLink slangPreCondit Special
178 HiLink slrnrcComment Comment
179 HiLink slrnrcVarInt Identifier
180 HiLink slrnrcVarStr Identifier
181 HiLink slrnrcCmd slrnrcSet
182 HiLink slrnrcSet Operator
183 HiLink slrnrcColor Keyword
184 HiLink slrnrcColorObj Identifier
185 HiLink slrnrcColorVal String
186 HiLink slrnrcMono Keyword
187 HiLink slrnrcMonoObj Identifier
188 HiLink slrnrcMonoVal String
189 HiLink slrnrcFunArt Macro
190 HiLink slrnrcFunGroup Macro
191 HiLink slrnrcFunRead Macro
192 HiLink slrnrcSetkeyObj Identifier
193 HiLink slrnrcSetkey Keyword
194 HiLink slrnrcUnsetkey slrnrcSetkey
196 "HiLink slrnrcObsolete Special
201 let b:current_syntax = "slrnrc"
203 "EOF vim: ts=8 noet tw=120 sw=8 sts=0