blob: 1924996738e58845c7f85a4545d11f8891bb091b [file] [log] [blame]
Bram Moolenaarf9132812015-07-21 19:19:13 +02001" Vim syntax file
2" Language: Tera Term Language (TTL)
Bram Moolenaar7571d552016-08-18 22:54:46 +02003" Based on Tera Term Version 4.92
Bram Moolenaarf9132812015-07-21 19:19:13 +02004" Maintainer: Ken Takata
5" URL: https://github.com/k-takata/vim-teraterm
Bram Moolenaar7571d552016-08-18 22:54:46 +02006" Last Change: 2016 Aug 17
Bram Moolenaarf9132812015-07-21 19:19:13 +02007" Filenames: *.ttl
8" License: VIM License
9
10if exists("b:current_syntax")
11 finish
12endif
13
14let s:save_cpo = &cpo
15set cpo&vim
16
17syn case ignore
18
19syn region ttlComment start=";" end="$" contains=@Spell
20syn region ttlComment start="/\*" end="\*/" contains=@Spell
21syn region ttlFirstComment start="/\*" end="\*/" contained contains=@Spell
22 \ nextgroup=ttlStatement,ttlFirstComment
23
24syn match ttlCharacter "#\%(\d\+\|\$\x\+\)\>"
25syn match ttlNumber "\%(\<\d\+\|\$\x\+\)\>"
26syn match ttlString "'[^']*'" contains=@Spell
27syn match ttlString '"[^"]*"' contains=@Spell
28syn cluster ttlConstant contains=ttlCharacter,ttlNumber,ttlString
29
30syn match ttlLabel ":\s*\w\{1,32}\>"
31
32syn keyword ttlOperator and or xor not
33
34syn match ttlVar "\<groupmatchstr\d\>"
35syn match ttlVar "\<param\d\>"
Bram Moolenaar7571d552016-08-18 22:54:46 +020036syn keyword ttlVar inputstr matchstr paramcnt params result timeout mtimeout
Bram Moolenaarf9132812015-07-21 19:19:13 +020037
38
39syn match ttlLine nextgroup=ttlStatement "^"
40syn match ttlStatement contained "\s*"
41 \ nextgroup=ttlIf,ttlElseIf,ttlConditional,ttlRepeat,
42 \ ttlFirstComment,ttlComment,ttlLabel,@ttlCommand
43
44syn cluster ttlCommand contains=ttlControlCommand,ttlCommunicationCommand,
45 \ ttlStringCommand,ttlFileCommand,ttlPasswordCommand,
46 \ ttlMiscCommand
47
48
49syn keyword ttlIf contained nextgroup=ttlIfExpression if
50syn keyword ttlElseIf contained nextgroup=ttlElseIfExpression elseif
51
52syn match ttlIfExpression contained "\s.*"
53 \ contains=@ttlConstant,ttlVar,ttlOperator,ttlComment,ttlThen,
54 \ @ttlCommand
55syn match ttlElseIfExpression contained "\s.*"
56 \ contains=@ttlConstant,ttlVar,ttlOperator,ttlComment,ttlThen
57
58syn keyword ttlThen contained then
59syn keyword ttlConditional contained else endif
60
61syn keyword ttlRepeat contained for next until enduntil while endwhile
62syn match ttlRepeat contained
63 \ "\<\%(do\|loop\)\%(\s\+\%(while\|until\)\)\?\>"
64syn keyword ttlControlCommand contained
65 \ break call continue end execcmnd exit goto include
66 \ mpause pause return
67
68
69syn keyword ttlCommunicationCommand contained
70 \ bplusrecv bplussend callmenu changedir clearscreen
71 \ closett connect cygconnect disconnect dispstr
72 \ enablekeyb flushrecv gethostname getmodemstatus
73 \ gettitle kmtfinish kmtget kmtrecv kmtsend loadkeymap
74 \ logautoclosemode logclose loginfo logopen logpause
75 \ logrotate logstart logwrite quickvanrecv
76 \ quickvansend recvln restoresetup scprecv scpsend
77 \ send sendbreak sendbroadcast sendfile sendkcode
78 \ sendln sendlnbroadcast sendmulticast setbaud
79 \ setdebug setdtr setecho setmulticastname setrts
80 \ setsync settitle showtt testlink unlink wait
81 \ wait4all waitevent waitln waitn waitrecv waitregex
82 \ xmodemrecv xmodemsend ymodemrecv ymodemsend
83 \ zmodemrecv zmodemsend
84syn keyword ttlStringCommand contained
85 \ code2str expandenv int2str regexoption sprintf
86 \ sprintf2 str2code str2int strcompare strconcat
87 \ strcopy strinsert strjoin strlen strmatch strremove
88 \ strreplace strscan strspecial strsplit strtrim
89 \ tolower toupper
90syn keyword ttlFileCommand contained
91 \ basename dirname fileclose fileconcat filecopy
92 \ filecreate filedelete filelock filemarkptr fileopen
93 \ filereadln fileread filerename filesearch fileseek
94 \ fileseekback filestat filestrseek filestrseek2
95 \ filetruncate fileunlock filewrite filewriteln
96 \ findfirst findnext findclose foldercreate
97 \ folderdelete foldersearch getdir getfileattr makepath
98 \ setdir setfileattr
99syn keyword ttlPasswordCommand contained
100 \ delpassword getpassword ispassword passwordbox
101 \ setpassword
102syn keyword ttlMiscCommand contained
103 \ beep bringupbox checksum8 checksum8file checksum16
104 \ checksum16file checksum32 checksum32file closesbox
105 \ clipb2var crc16 crc16file crc32 crc32file exec
106 \ dirnamebox filenamebox getdate getenv getipv4addr
107 \ getipv6addr getspecialfolder gettime getttdir getver
108 \ ifdefined inputbox intdim listbox messagebox random
109 \ rotateleft rotateright setdate setdlgpos setenv
110 \ setexitcode settime show statusbox strdim uptime
111 \ var2clipb yesnobox
112
113
114hi def link ttlCharacter Character
115hi def link ttlNumber Number
116hi def link ttlComment Comment
117hi def link ttlFirstComment Comment
118hi def link ttlString String
119hi def link ttlLabel Label
120hi def link ttlIf Conditional
121hi def link ttlElseIf Conditional
122hi def link ttlThen Conditional
123hi def link ttlConditional Conditional
124hi def link ttlRepeat Repeat
125hi def link ttlControlCommand Keyword
126hi def link ttlVar Identifier
127hi def link ttlOperator Operator
128hi def link ttlCommunicationCommand Keyword
129hi def link ttlStringCommand Keyword
130hi def link ttlFileCommand Keyword
131hi def link ttlPasswordCommand Keyword
132hi def link ttlMiscCommand Keyword
133
134let b:current_syntax = "teraterm"
135
136let &cpo = s:save_cpo
137unlet s:save_cpo
138
139" vim: ts=8 sw=2 sts=2