blob: df6adcf81960b899e4e1a54d6d221d45f9d09640 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: tf
3" Maintainer: Lutz Eymers <ixtab@polzin.com>
4" URL: http://www.isp.de/data/tf.vim
5" Email: send syntax_vim.tgz
6" Last Change: 2001 May 10
7"
8" Options lite_minlines = x to sync at least x lines backwards
9
10" Remove any old syntax stuff hanging around
11
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020012" quit when a syntax file was already loaded
13if exists("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +000014 finish
15endif
16
17syn case match
18
19if !exists("main_syntax")
20 let main_syntax = 'tf'
21endif
22
23" Special global variables
24syn keyword tfVar HOME LANG MAIL SHELL TERM TFHELP TFLIBDIR TFLIBRARY TZ contained
25syn keyword tfVar background backslash contained
26syn keyword tfVar bamf bg_output borg clearfull cleardone clock connect contained
27syn keyword tfVar emulation end_color gag gethostbyname gpri hook hilite contained
28syn keyword tfVar hiliteattr histsize hpri insert isize istrip kecho contained
29syn keyword tfVar kprefix login lp lpquote maildelay matching max_iter contained
Viktor Szépe3fc7a7e2023-08-23 21:20:00 +020030syn keyword tfVar max_recur mecho more mprefix oldslash prompt_sec contained
Bram Moolenaar071d4272004-06-13 20:20:40 +000031syn keyword tfVar prompt_usec proxy_host proxy_port ptime qecho qprefix contained
32syn keyword tfVar quite quitdone redef refreshtime scroll shpause snarf sockmload contained
33syn keyword tfVar start_color tabsize telopt sub time_format visual contained
34syn keyword tfVar watch_dog watchname wordpunct wrap wraplog wrapsize contained
35syn keyword tfVar wrapspace contained
36
37" Worldvar
38syn keyword tfWorld world_name world_character world_password world_host contained
39syn keyword tfWorld world_port world_mfile world_type contained
40
41" Number
42syn match tfNumber "-\=\<\d\+\>"
43
44" Float
45syn match tfFloat "\(-\=\<\d+\|-\=\)\.\d\+\>"
46
47" Operator
48syn match tfOperator "[-+=?:&|!]"
49syn match tfOperator "/[^*~@]"he=e-1
50syn match tfOperator ":="
51syn match tfOperator "[^/%]\*"hs=s+1
52syn match tfOperator "$\+[([{]"he=e-1,me=e-1
53syn match tfOperator "\^\[\+"he=s+1 contains=tfSpecialCharEsc
54
55" Relational
56syn match tfRelation "&&"
57syn match tfRelation "||"
58syn match tfRelation "[<>/!=]="
59syn match tfRelation "[<>]"
60syn match tfRelation "[!=]\~"
61syn match tfRelation "[=!]/"
62
63
64" Readonly Var
65syn match tfReadonly "[#*]" contained
66syn match tfReadonly "\<-\=L\=\d\{-}\>" contained
67syn match tfReadonly "\<P\(\d\+\|R\|L\)\>" contained
68syn match tfReadonly "\<R\>" contained
69
70" Identifier
71syn match tfIdentifier "%\+[a-zA-Z_#*-0-9]\w*" contains=tfVar,tfReadonly
72syn match tfIdentifier "%\+[{]"he=e-1,me=e-1
73syn match tfIdentifier "\$\+{[a-zA-Z_#*-0-9]\w*}" contains=tfWorld
74
75" Function names
76syn keyword tfFunctions ascii char columns echo filename ftime fwrite getopts
77syn keyword tfFunctions getpid idle kbdel kbgoto kbhead kblen kbmatch kbpoint
78syn keyword tfFunctions kbtail kbwordleft kbwordright keycode lines mod
79syn keyword tfFunctions moresize pad rand read regmatch send strcat strchr
80syn keyword tfFunctions strcmp strlen strncmp strrchr strrep strstr substr
81syn keyword tfFunctions systype time tolower toupper
82
83syn keyword tfStatement addworld bamf beep bind break cat changes connect contained
84syn keyword tfStatement dc def dokey echo edit escape eval export expr fg for contained
85syn keyword tfStatement gag getfile grab help hilite histsize hook if input contained
86syn keyword tfStatement kill lcd let list listsockets listworlds load contained
87syn keyword tfStatement localecho log nohilite not partial paste ps purge contained
88syn keyword tfStatement purgeworld putfile quit quote recall recordline save contained
89syn keyword tfStatement saveworld send sh shift sub substitute contained
90syn keyword tfStatement suspend telnet test time toggle trig trigger unbind contained
91syn keyword tfStatement undef undefn undeft unhook untrig unworld contained
92syn keyword tfStatement version watchdog watchname while world contained
93
94" Hooks
95syn keyword tfHook ACTIVITY BACKGROUND BAMF CONFAIL CONFLICT CONNECT DISCONNECT
96syn keyword tfHook KILL LOAD LOADFAIL LOG LOGIN MAIL MORE PENDING PENDING
97syn keyword tfHook PROCESS PROMPT PROXY REDEF RESIZE RESUME SEND SHADOW SHELL
98syn keyword tfHook SIGHUP SIGTERM SIGUSR1 SIGUSR2 WORLD
99
100" Conditional
101syn keyword tfConditional if endif then else elseif contained
102
103" Repeat
104syn keyword tfRepeat while do done repeat for contained
105
106" Statement
107syn keyword tfStatement break quit contained
108
109" Include
110syn keyword tfInclude require load save loaded contained
111
112" Define
113syn keyword tfDefine bind unbind def undef undefn undefn purge hook unhook trig untrig contained
114syn keyword tfDefine set unset setenv contained
115
116" Todo
117syn keyword tfTodo TODO Todo todo contained
118
119" SpecialChar
120syn match tfSpecialChar "\\[abcfnrtyv\\]" contained
121syn match tfSpecialChar "\\\d\{3}" contained contains=tfOctalError
122syn match tfSpecialChar "\\x[0-9a-fA-F]\{2}" contained
123syn match tfSpecialCharEsc "\[\+" contained
124
125syn match tfOctalError "[89]" contained
126
127" Comment
128syn region tfComment start="^;" end="$" contains=tfTodo
129
130" String
131syn region tfString oneline matchgroup=None start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=tfIdentifier,tfSpecialChar,tfEscape
132syn region tfString matchgroup=None start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=tfIdentifier,tfSpecialChar,tfEscape
133
134syn match tfParentError "[)}\]]"
135
136" Parents
137syn region tfParent matchgroup=Delimiter start="(" end=")" contains=ALLBUT,tfReadonly
138syn region tfParent matchgroup=Delimiter start="\[" end="\]" contains=ALL
139syn region tfParent matchgroup=Delimiter start="{" end="}" contains=ALL
140
141syn match tfEndCommand "%%\{-};"
142syn match tfJoinLines "\\$"
143
144" Types
145
146syn match tfType "/[a-zA-Z_~@][a-zA-Z0-9_]*" contains=tfConditional,tfRepeat,tfStatement,tfInclude,tfDefine,tfStatement
147
148" Catch /quote .. '
149syn match tfQuotes "/quote .\{-}'" contains=ALLBUT,tfString
150" Catch $(/escape )
151syn match tfEscape "(/escape .*)"
152
153" sync
154if exists("tf_minlines")
155 exec "syn sync minlines=" . tf_minlines
156else
157 syn sync minlines=100
158endif
159
160" Define the default highlighting.
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200161" Only when an item doesn't have highlighting yet
Bram Moolenaar071d4272004-06-13 20:20:40 +0000162
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200163hi def link tfComment Comment
164hi def link tfString String
165hi def link tfNumber Number
166hi def link tfFloat Float
167hi def link tfIdentifier Identifier
168hi def link tfVar Identifier
169hi def link tfWorld Identifier
170hi def link tfReadonly Identifier
171hi def link tfHook Identifier
172hi def link tfFunctions Function
173hi def link tfRepeat Repeat
174hi def link tfConditional Conditional
175hi def link tfLabel Label
176hi def link tfStatement Statement
177hi def link tfType Type
178hi def link tfInclude Include
179hi def link tfDefine Define
180hi def link tfSpecialChar SpecialChar
181hi def link tfSpecialCharEsc SpecialChar
182hi def link tfParentError Error
183hi def link tfTodo Todo
184hi def link tfEndCommand Delimiter
185hi def link tfJoinLines Delimiter
186hi def link tfOperator Operator
187hi def link tfRelation Operator
Bram Moolenaar071d4272004-06-13 20:20:40 +0000188
Bram Moolenaar071d4272004-06-13 20:20:40 +0000189
190let b:current_syntax = "tf"
191
192if main_syntax == 'tf'
193 unlet main_syntax
194endif
195
196" vim: ts=8