?? tads.vim
字號:
" Vim syntax file" Language: TADS" Maintainer: Amir Karger <karger@post.harvard.edu>" $Date: 2001/06/07 21:35:13 $" $Revision: 1.1.1.1 $" Stolen from: Bram Moolenaar's C language file" Newest version at: http://www.hec.utah.edu/~karger/vim/syntax/tads.vim" History info at the bottom of the file" TODO lots more keywords" global, self, etc. are special *objects*, not functions. They should" probably be a different color than the special functions" Actually, should cvtstr etc. be functions?! (change tadsFunction)" Make global etc. into Identifiers, since we don't have regular variables?" 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") finishendif" A bunch of useful keywordssyn keyword tadsStatement goto break return continue passsyn keyword tadsLabel case defaultsyn keyword tadsConditional if else switchsyn keyword tadsRepeat while for dosyn keyword tadsStorageClass local compoundWord formatstring specialWordssyn keyword tadsBoolean nil true" TADS keywordssyn keyword tadsKeyword replace modifysyn keyword tadsKeyword global self inherited" builtin functionssyn keyword tadsKeyword cvtstr cvtnum caps lower upper substrsyn keyword tadsKeyword say lengthsyn keyword tadsKeyword setit setscoresyn keyword tadsKeyword datatype proptypesyn keyword tadsKeyword car cdrsyn keyword tadsKeyword defined isclasssyn keyword tadsKeyword find firstobj nextobjsyn keyword tadsKeyword getarg argcountsyn keyword tadsKeyword input yorn askfilesyn keyword tadsKeyword rand randomizesyn keyword tadsKeyword restart restore quit save undosyn keyword tadsException abort exit exitobjsyn keyword tadsTodo contained TODO FIXME XXX" String and Character constants" Highlight special characters (those which have a backslash) differentlysyn match tadsSpecial contained "\\."syn region tadsDoubleString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=tadsSpecial,tadsEmbeddedsyn region tadsSingleString start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=tadsSpecial" Embedded expressions in stringssyn region tadsEmbedded contained start="<<" end=">>" contains=tadsKeyword" TADS doesn't have \xxx, right?"syn match cSpecial contained "\\[0-7][0-7][0-7]\=\|\\.""syn match cSpecialCharacter "'\\[0-7][0-7]'""syn match cSpecialCharacter "'\\[0-7][0-7][0-7]'""catch errors caused by wrong parenthesis"syn region cParen transparent start='(' end=')' contains=ALLBUT,cParenError,cIncluded,cSpecial,cTodo,cUserCont,cUserLabel"syn match cParenError ")""syn match cInParen contained "[{}]"syn region tadsBrace transparent start='{' end='}' contains=ALLBUT,tadsBraceError,tadsIncluded,tadsSpecial,tadsTodosyn match tadsBraceError "}""integer number (TADS has no floating point numbers)syn case ignoresyn match tadsNumber "\<[0-9]\+\>""hex numbersyn match tadsNumber "\<0x[0-9a-f]\+\>"syn match tadsIdentifier "\<[a-z][a-z0-9_$]*\>"syn case match" flag an octal number with wrong digitssyn match tadsOctalError "\<0[0-7]*[89]"" Removed complicated c_comment_stringssyn region tadsComment start="/\*" end="\*/" contains=tadsTodosyn match tadsComment "//.*" contains=tadsTodosyntax match tadsCommentError "\*/"syn region tadsPreCondit start="^\s*#\s*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=tadsComment,tadsString,tadsNumber,tadsCommentErrorsyn region tadsIncluded contained start=+"+ skip=+\\\\\|\\"+ end=+"+syn match tadsIncluded contained "<[^>]*>"syn match tadsInclude "^\s*#\s*include\>\s*["<]" contains=tadsIncludedsyn region tadsDefine start="^\s*#\s*\(define\>\|undef\>\)" skip="\\$" end="$" contains=ALLBUT,tadsPreCondit,tadsIncluded,tadsInclude,tadsDefine,tadsInBrace,tadsIdentifiersyn region tadsPreProc start="^\s*#\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" contains=ALLBUT,tadsPreCondit,tadsIncluded,tadsInclude,tadsDefine,tadsInParen,tadsIdentifier" Highlight User Labels" TODO labels for gotos?"syn region cMulti transparent start='?' end=':' contains=ALLBUT,cIncluded,cSpecial,cTodo,cUserCont,cUserLabel,cBitField" Avoid matching foo::bar() in C++ by requiring that the next char is not ':'"syn match cUserCont "^\s*\I\i*\s*:$" contains=cUserLabel"syn match cUserCont ";\s*\I\i*\s*:$" contains=cUserLabel"syn match cUserCont "^\s*\I\i*\s*:[^:]" contains=cUserLabel"syn match cUserCont ";\s*\I\i*\s*:[^:]" contains=cUserLabel"syn match cUserLabel "\I\i*" contained" identifier: class-name [, class-name [...]] [property-list] ;" Don't highlight comment in class defsyn match tadsClassDef "\<class\>[^/]*" contains=tadsObjectDef,tadsClasssyn match tadsClass contained "\<class\>"syn match tadsObjectDef "\<[a-zA-Z][a-zA-Z0-9_$]*\s*:\s*[a-zA-Z0-9_$]\+\(\s*,\s*[a-zA-Z][a-zA-Z0-9_$]*\)*\(\s*;\)\="syn keyword tadsFunction contained functionsyn match tadsFunctionDef "\<[a-zA-Z][a-zA-Z0-9_$]*\s*:\s*function[^{]*" contains=tadsFunction"syn region tadsObject transparent start = '[a-zA-Z][\i$]\s*:\s*' end=";" contains=tadsBrace,tadsObjectDef" How far back do we go to find matching groupsif !exists("tads_minlines") let tads_minlines = 15endifexec "syn sync ccomment tadsComment minlines=" . tads_minlinesif !exists("tads_sync_dist") let tads_sync_dist = 100endifexecute "syn sync maxlines=" . tads_sync_dist" 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_tads_syn_inits") if version < 508 let did_tads_syn_inits = 1 command -nargs=+ HiLink hi link <args> else command -nargs=+ HiLink hi def link <args> endif " The default methods for highlighting. Can be overridden later HiLink tadsFunctionDef Function HiLink tadsFunction Structure HiLink tadsClass Structure HiLink tadsClassDef Identifier HiLink tadsObjectDef Identifier" no highlight for tadsEmbedded, so it prints as normal text w/in the string HiLink tadsOperator Operator HiLink tadsStructure Structure HiLink tadsTodo Todo HiLink tadsLabel Label HiLink tadsConditional Conditional HiLink tadsRepeat Repeat HiLink tadsException Exception HiLink tadsStatement Statement HiLink tadsStorageClass StorageClass HiLink tadsKeyWord Keyword HiLink tadsSpecial SpecialChar HiLink tadsNumber Number HiLink tadsBoolean Boolean HiLink tadsDoubleString tadsString HiLink tadsSingleString tadsString HiLink tadsOctalError tadsError HiLink tadsCommentError tadsError HiLink tadsBraceError tadsError HiLink tadsInBrace tadsError HiLink tadsError Error HiLink tadsInclude Include HiLink tadsPreProc PreProc HiLink tadsDefine Macro HiLink tadsIncluded tadsString HiLink tadsPreCondit PreCondit HiLink tadsString String HiLink tadsComment Comment delcommand HiLinkendiflet b:current_syntax = "tads"" Changes:" 11/18/99 Added a bunch of TADS functions, tadsException" 10/22/99 Misspelled Moolenaar (sorry!), c_minlines to tads_minlines"" vim: ts=8
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -