1" Vim syntax file 2" Language: Tera Term Language (TTL) 3" Based on Tera Term Version 4.100 4" Maintainer: Ken Takata 5" URL: https://github.com/k-takata/vim-teraterm 6" Last Change: 2018-08-31 7" 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\>" 36syn keyword ttlVar inputstr matchstr paramcnt params result timeout mtimeout 37 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 sendlnmulticast sendmulticast 79 \ setbaud setdebug setdtr setecho setflowctrl 80 \ setmulticastname setrts setspeed setsync settitle 81 \ showtt testlink unlink wait wait4all waitevent 82 \ waitln waitn waitrecv waitregex xmodemrecv 83 \ xmodemsend ymodemrecv ymodemsend zmodemrecv 84 \ zmodemsend 85syn keyword ttlStringCommand contained 86 \ code2str expandenv int2str regexoption sprintf 87 \ sprintf2 str2code str2int strcompare strconcat 88 \ strcopy strinsert strjoin strlen strmatch strremove 89 \ strreplace strscan strspecial strsplit strtrim 90 \ tolower toupper 91syn keyword ttlFileCommand contained 92 \ basename dirname fileclose fileconcat filecopy 93 \ filecreate filedelete filelock filemarkptr fileopen 94 \ filereadln fileread filerename filesearch fileseek 95 \ fileseekback filestat filestrseek filestrseek2 96 \ filetruncate fileunlock filewrite filewriteln 97 \ findfirst findnext findclose foldercreate 98 \ folderdelete foldersearch getdir getfileattr makepath 99 \ setdir setfileattr 100syn keyword ttlPasswordCommand contained 101 \ delpassword getpassword ispassword passwordbox 102 \ setpassword 103syn keyword ttlMiscCommand contained 104 \ beep bringupbox checksum8 checksum8file checksum16 105 \ checksum16file checksum32 checksum32file closesbox 106 \ clipb2var crc16 crc16file crc32 crc32file exec 107 \ dirnamebox filenamebox getdate getenv getipv4addr 108 \ getipv6addr getspecialfolder gettime getttdir getver 109 \ ifdefined inputbox intdim listbox messagebox random 110 \ rotateleft rotateright setdate setdlgpos setenv 111 \ setexitcode settime show statusbox strdim uptime 112 \ var2clipb yesnobox 113 114 115hi def link ttlCharacter Character 116hi def link ttlNumber Number 117hi def link ttlComment Comment 118hi def link ttlFirstComment Comment 119hi def link ttlString String 120hi def link ttlLabel Label 121hi def link ttlIf Conditional 122hi def link ttlElseIf Conditional 123hi def link ttlThen Conditional 124hi def link ttlConditional Conditional 125hi def link ttlRepeat Repeat 126hi def link ttlControlCommand Keyword 127hi def link ttlVar Identifier 128hi def link ttlOperator Operator 129hi def link ttlCommunicationCommand Keyword 130hi def link ttlStringCommand Keyword 131hi def link ttlFileCommand Keyword 132hi def link ttlPasswordCommand Keyword 133hi def link ttlMiscCommand Keyword 134 135let b:current_syntax = "teraterm" 136 137let &cpo = s:save_cpo 138unlet s:save_cpo 139 140" vim: ts=8 sw=2 sts=2 141