Skip to content

Instantly share code, notes, and snippets.

@fourside
Created July 21, 2012 04:33
Show Gist options
  • Save fourside/3154584 to your computer and use it in GitHub Desktop.
Save fourside/3154584 to your computer and use it in GitHub Desktop.
syntax file for teraterm macro.
"Vim syntax file
"Language: TeraTerm Macro Language(ttl)
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
syn keyword ttlStatement goto call end include return call execcmnd exit pause mpause
syn keyword ttlRepeat for next while endwhile
syn keyword ttlRepeat do loop break untile enduntil
syn keyword ttlConditional if then elseif else endif
syn keyword ttlOperator and not or xor
" system variables
syn keyword ttlArgument param1 param2 param3 param4 param5 param6 param7 param8 param9 paramcnt
syn keyword ttlArgument groupmatchstr1 groupmatchstr2 groupmatchstr3 groupmatchstr4 groupmatchstr5
syn keyword ttlArgument groupmatchstr6 groupmatchstr7 groupmatchstr8 groupmatchstr9 matchstr
syn keyword ttlArgument result timeout mtimeout inputstr
syn match ttlOperator "\s[-+\*/%]\s"
syn match ttlOperator "="
syn match ttlOperator "\s\(<\|>\)\s"
syn match ttlString "\"[^"]*\""
syn match ttlString "\'[^']*\'"
syn match ttlString "#1[0-1][0-9]\|#1[2][0-7]\|#[1-9][0-9]\|#[1-9]"
syn match ttlString "#$[0-7]\x"
syn match ttlLabel "^\s*:\s*\h\w*\>"
syn match ttlLabel "\<\(goto\|call\)\s\+:\h\w*\>"
syn match ttlLabel "\<goto\s\+\h\w*\>"
syn match ttlLabel ":\h\w*\>"
syn match ttlComment ";.*$"
syn region ttlComment start="/\*" end="\*/"
syn keyword ttlImplicit bplusrecv bplussend changedir clearscreen closett
syn keyword ttlImplicit connect disconnect enablekeyb flushrecv gettitle
syn keyword ttlImplicit kmtfinish kmtget kmtrecv kmtsend loadkeymap logclose
syn keyword ttlImplicit logopen logpause logstart logwrite quickvanrecv quickvansend
syn keyword ttlImplicit recvln restoresetup send sendbreak sendfile sendkcode
syn keyword ttlImplicit sendln setecho setsync settitle showtt testlink unlink
syn keyword ttlImplicit wait waitevent waitln waitrecv xmodemrecv xmoddemsend
syn keyword ttlImplicit zmodemrecv zmodemsend
syn keyword ttlImplicit code2str int2str str2code str2int strcompare strconcat
syn keyword ttlImplicit strcopy strlen strscan
syn keyword ttlImplicit fileclose fileconcat filecopy filecreate filedelete
syn keyword ttlImplicit filemarkptr fileopen fileopen filereadln filerename
syn keyword ttlImplicit filesearch fileseek fileseekback filestrseek filestrseek2
syn keyword ttlImplicit filewrite filewriteln findfirst findnext findclose
syn keyword ttlImplicit getdir makepath setdir
syn keyword ttlImplicit delpassword getpassword passwordbox
syn keyword ttlImplicit beep closesbox exec getdate getenv gettime inputbox messagebox
syn keyword ttlImplicit setdate setdlgpos setexitcode settime show statusbox yesnobox
" new ttl commands
syn keyword ttlImplicit callmenu cygconnect dispstr gethostname loginfo scprecv scpsend
syn keyword ttlImplicit sendbroadcast sendlnbroadcast sendmulticast setbaud setdebug setdtr
syn keyword ttlImplicit setmulticastname setrts wait4all waitn waitregex ymodemrecv ymodemsend
syn keyword ttlImplicit expandenv sprintf sprintf2 strinsert strjoin strmatch strremove
syn keyword ttlImplicit strreplace strspecial strsplit strtrim tolower toupper
syn keyword ttlImplicit basename dirname filelock fileread filestat filetruncate fileunlock
syn keyword ttlImplicit foldercreate folderdelete foldersearch getfileattr setfileattr
syn keyword ttlImplicit ispassword setpassword
syn keyword ttlImplicit clipb2var crc32 crc32file filenamebox getspecialfolder getttdir getver
syn keyword ttlImplicit ifdefined intdim random rotateleft rotateright setenv strdim var2clipb
if version >= 508 || !exists("did_ttl_syntax_inits")
if version < 508
let did_ttl_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink ttlStatement Statement
HiLink ttlLabel Label
HiLink ttlConditional Conditional
HiLink ttlRepeat Repeat
HiLink ttlOperator Operator
HiLink ttlArgument Identifier
HiLink ttlString String
HiLink ttlComment Comment
HiLink ttlImplicit Function
delcommand HiLink
endif
let b:current_syntax = "ttl"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment