📄 btm.vim
字号:
" Vim syntax file" Language: 4Dos batch file" Maintainer: John Leo Spetz <jls11@po.cwru.edu>" Last Change: 2001 May 09"//Issues to resolve:"//- Boolean operators surrounded by period are recognized but the"// periods are not highlighted. The only way to do that would"// be separate synmatches for each possibility otherwise a more"// general \.\i\+\. will highlight anything delimited by dots."//- After unary operators like "defined" can assume token type."// Should there be more of these?" For version 5.x: Clear all syntax items" For version 6.x: Quit when a syntax file was already loadedif version < 600 syntax clearelseif exists("b:current_syntax") finishendifsyn case ignoresyn keyword btmStatement call offsyn keyword btmConditional if iff endiff then else elseiff not errorlevelsyn keyword btmConditional gt lt eq ne ge lesyn match btmConditional transparent "\.\i\+\." contains=btmDotBoolOpsyn keyword btmDotBoolOp contained and or xorsyn match btmConditional "=="syn match btmConditional "!="syn keyword btmConditional defined errorlevel exist isaliassyn keyword btmConditional isdir direxist isinternal islabelsyn keyword btmRepeat for in do enddosyn keyword btmTodo contained TODO" Stringsyn cluster btmVars contains=btmVariable,btmArgument,btmBIFMatchsyn region btmString start=+"+ end=+"+ contains=@btmVarssyn match btmNumber "\<\d\+\>""syn match btmIdentifier "\<\h\w*\>"" If you don't like tabs"syn match btmShowTab "\t""syn match btmShowTabc "\t""syn match btmComment "^\ *rem.*$" contains=btmTodo,btmShowTabc" Some people use this as a comment line" In fact this is a Label"syn match btmComment "^\ *:\ \+.*$" contains=btmTodosyn match btmComment "^\ *rem.*$" contains=btmTodosyn match btmComment "^\ *::.*$" contains=btmTodosyn match btmLabelMark "^\ *:[0-9a-zA-Z_\-]\+\>"syn match btmLabelMark "goto [0-9a-zA-Z_\-]\+\>"lc=5syn match btmLabelMark "gosub [0-9a-zA-Z_\-]\+\>"lc=6" syn match btmCmdDivider ">[>&][>&]\="syn match btmCmdDivider ">[>&]*"syn match btmCmdDivider ">>&>"syn match btmCmdDivider "|&\="syn match btmCmdDivider "%+"syn match btmCmdDivider "\^"syn region btmEcho start="echo" skip="echo" matchgroup=btmCmdDivider end="%+" end="$" end="|&\=" end="\^" end=">[>&]*" contains=@btmEchos onelinesyn cluster btmEchos contains=@btmVars,btmEchoCommand,btmEchoParamsyn keyword btmEchoCommand contained echo echoerr echos echoserrsyn keyword btmEchoParam contained on off" this is also a valid Label. I don't use it."syn match btmLabelMark "^\ *:\ \+[0-9a-zA-Z_\-]\+\>"" //Environment variable can be expanded using notation %var in 4DOSsyn match btmVariable "%[0-9a-z_\-]\+" contains=@btmSpecialVars" //Environment variable can be expanded using notation %var%syn match btmVariable "%[0-9a-z_\-]*%" contains=@btmSpecialVars" //The following are special variable in 4DOSsyn match btmVariable "%[=#]" contains=@btmSpecialVarssyn match btmVariable "%??\=" contains=@btmSpecialVars" //Environment variable can be expanded using notation %[var] in 4DOSsyn match btmVariable "%\[[0-9a-z_\-]*\]"" //After some keywords next word should be an environment variablesyn match btmVariable "defined\s\i\+"lc=8syn match btmVariable "set\s\i\+"lc=4" //Parameters to batchfiles take the format %<digit>syn match btmArgument "%\d\>"" //4DOS allows format %<digit>& meaning batchfile parameters digit and upsyn match btmArgument "%\d\>&"" //Variable used by FOR loops sometimes use %%<letter> in batchfilessyn match btmArgument "%%\a\>"" //Show 4DOS built-in functions speciallysyn match btmBIFMatch "%@\w\+\["he=e-1 contains=btmBuiltInFuncsyn keyword btmBuiltInFunc contained alias ascii attrib cdromsyn keyword btmBuiltInFunc contained char clip comma convertsyn keyword btmBuiltInFunc contained date day dec descriptsyn keyword btmBuiltInFunc contained device diskfree disktotalsyn keyword btmBuiltInFunc contained diskused dosmem dow dowisyn keyword btmBuiltInFunc contained doy ems eval exec execstrsyn keyword btmBuiltInFunc contained expand ext extendedsyn keyword btmBuiltInFunc contained fileage fileclose filedatesyn keyword btmBuiltInFunc contained filename fileopen filereadsyn keyword btmBuiltInFunc contained files fileseek fileseeklsyn keyword btmBuiltInFunc contained filesize filetime filewritesyn keyword btmBuiltInFunc contained filewriteb findclosesyn keyword btmBuiltInFunc contained findfirst findnext formatsyn keyword btmBuiltInFunc contained full if inc index insertsyn keyword btmBuiltInFunc contained instr int label left lensyn keyword btmBuiltInFunc contained lfn line lines lower lptsyn keyword btmBuiltInFunc contained makeage makedate maketimesyn keyword btmBuiltInFunc contained master month name numericsyn keyword btmBuiltInFunc contained path random readscr readysyn keyword btmBuiltInFunc contained remote removable repeatsyn keyword btmBuiltInFunc contained replace right searchsyn keyword btmBuiltInFunc contained select sfn strip substrsyn keyword btmBuiltInFunc contained time timer trim truenamesyn keyword btmBuiltInFunc contained unique upper wild wordsyn keyword btmBuiltInFunc contained words xms yearsyn cluster btmSpecialVars contains=btmBuiltInVar,btmSpecialVar" //Show specialized variables specially" syn match btmSpecialVar contained "+"syn match btmSpecialVar contained "="syn match btmSpecialVar contained "#"syn match btmSpecialVar contained "??\="syn keyword btmSpecialVar contained cmdline colordir comspecsyn keyword btmSpecialVar contained copycmd dircmd temp temp4dossyn keyword btmSpecialVar contained filecompletion path prompt" //Show 4DOS built-in variables specially speciallysyn keyword btmBuiltInVar contained _4ver _alias _ansisyn keyword btmBuiltInVar contained _apbatt _aplife _apmac _batchsyn keyword btmBuiltInVar contained _batchline _batchname _bgsyn keyword btmBuiltInVar contained _boot _ci _cmdproc _cosyn keyword btmBuiltInVar contained _codepage _column _columnssyn keyword btmBuiltInVar contained _country _cpu _cwd _cwds _cwpsyn keyword btmBuiltInVar contained _cwps _date _day _disk _dnamesyn keyword btmBuiltInVar contained _dos _dosver _dow _dowi _doysyn keyword btmBuiltInVar contained _dpmi _dv _env _fg _hlogfilesyn keyword btmBuiltInVar contained _hour _kbhit _kstack _lastdisksyn keyword btmBuiltInVar contained _logfile _minute _monitorsyn keyword btmBuiltInVar contained _month _mouse _ndp _row _rowssyn keyword btmBuiltInVar contained _second _shell _swappingsyn keyword btmBuiltInVar contained _syserr _time _transientsyn keyword btmBuiltInVar contained _video _win _wintitle _year" //Commands in 4DOS and/or DOSsyn match btmCommand "\s?"syn match btmCommand "^?"syn keyword btmCommand alias append assign attribsyn keyword btmCommand backup beep break cancel casesyn keyword btmCommand cd cdd cdpath chcp chdirsyn keyword btmCommand chkdsk cls color comp copysyn keyword btmCommand ctty date debug default defragsyn keyword btmCommand del delay describe dirsyn keyword btmCommand dirhistory dirs diskcompsyn keyword btmCommand diskcopy doskey dosshellsyn keyword btmCommand drawbox drawhline drawvline"syn keyword btmCommand echo echoerr echos echoserrsyn keyword btmCommand edit edlin emm386 endlocalsyn keyword btmCommand endswitch erase eset exceptsyn keyword btmCommand exe2bin exit expand fastopensyn keyword btmCommand fc fdisk ffind find formatsyn keyword btmCommand free global gosub gotosyn keyword btmCommand graftabl graphics help historysyn keyword btmCommand inkey input join keyb keybdsyn keyword btmCommand keystack label lh list loadbtmsyn keyword btmCommand loadhigh lock log md memsyn keyword btmCommand memory mirror mkdir mode moresyn keyword btmCommand move nlsfunc on option pathsyn keyword btmCommand pause popd print prompt pushdsyn keyword btmCommand quit rd reboot recover rensyn keyword btmCommand rename replace restore returnsyn keyword btmCommand rmdir scandisk screen scrputsyn keyword btmCommand select set setdos setlocalsyn keyword btmCommand setver share shift sort substsyn keyword btmCommand swapping switch sys tee textsyn keyword btmCommand time timer touch tree truenamesyn keyword btmCommand type unalias undelete unformatsyn keyword btmCommand unlock unset ver verify volsyn keyword btmCommand vscrput y" Define the default highlighting." For version 5.7 and earlier: only when not done already" For version 5.8 and later: only when an item doesn't have highlighting yetif version >= 508 || !exists("did_btm_syntax_inits") if version < 508 let did_btm_syntax_inits = 1 command -nargs=+ HiLink hi link <args> else command -nargs=+ HiLink hi def link <args> endif HiLink btmLabel Special HiLink btmLabelMark Special HiLink btmCmdDivider Special HiLink btmConditional btmStatement HiLink btmDotBoolOp btmStatement HiLink btmRepeat btmStatement HiLink btmEchoCommand btmStatement HiLink btmEchoParam btmStatement HiLink btmStatement Statement HiLink btmTodo Todo HiLink btmString String HiLink btmNumber Number HiLink btmComment Comment HiLink btmArgument Identifier HiLink btmVariable Identifier HiLink btmEcho String HiLink btmBIFMatch btmStatement HiLink btmBuiltInFunc btmStatement HiLink btmBuiltInVar btmStatement HiLink btmSpecialVar btmStatement HiLink btmCommand btmStatement "optional highlighting "HiLink btmShowTab Error "HiLink btmShowTabc Error "hiLink btmIdentifier Identifier delcommand HiLinkendiflet b:current_syntax = "btm"" vim: ts=8
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -