📄 rebol.vim
字号:
" Vim syntax file" Language: Rebol" Maintainer: Mike Williams <mrw@netcomuk.co.uk>" Filenames: *.r" Last Change: 2001 May 09" URL: N/A"" Change history" 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" Rebol is case insensitivesyn case ignore" As per current users documentationif version < 600 set isk=@,48-57,?,!,.,',+,-,*,&,\|,=,_,~else setlocal isk=@,48-57,?,!,.,',+,-,*,&,\|,=,_,~endif" Yer TODO highlightersyn keyword rebolTodo contained TODO" Commentssyn match rebolComment ";.*$" contains=rebolTodo" Wordssyn match rebolWord "\a\k*"syn match rebolWordPath "[^[:space:]]/[^[:space]]"ms=s+1,me=e-1" Booleanssyn keyword rebolBoolean true false on off yes no" Values" Integerssyn match rebolInteger "\<[+-]\=\d\+\('\d*\)*\>"" Decimalssyn match rebolDecimal "[+-]\=\(\d\+\('\d*\)*\)\=[,.]\d*\(e[+-]\=\d\+\)\="syn match rebolDecimal "[+-]\=\d\+\('\d*\)*\(e[+-]\=\d\+\)\="" Timesyn match rebolTime "[+-]\=\(\d\+\('\d*\)*\:\)\{1,2}\d\+\('\d*\)*\([.,]\d\+\)\=\([AP]M\)\=\>"syn match rebolTime "[+-]\=:\d\+\([.,]\d*\)\=\([AP]M\)\=\>"" Dates" DD-MMM-YY & YYYY formatsyn match rebolDate "\d\{1,2}\([/-]\)\(Jan\|Feb\|Mar\|Apr\|May\|Jun\|Jul\|Aug\|Sep\|Oct\|Nov\|Dec\)\1\(\d\{2}\)\{1,2}\>"" DD-month-YY & YYYY formatsyn match rebolDate "\d\{1,2}\([/-]\)\(January\|February\|March\|April\|May\|June\|July\|August\|September\|October\|November\|December\)\1\(\d\{2}\)\{1,2}\>"" DD-MM-YY & YY formatsyn match rebolDate "\d\{1,2}\([/-]\)\d\{1,2}\1\(\d\{2}\)\{1,2}\>"" YYYY-MM-YY formatsyn match rebolDate "\d\{4}-\d\{1,2}-\d\{1,2}\>"" DD.MM.YYYY formatsyn match rebolDate "\d\{1,2}\.\d\{1,2}\.\d\{4}\>"" Moneysyn match rebolMoney "\a*\$\d\+\('\d*\)*\([,.]\d\+\)\="" Stringssyn region rebolString oneline start=+"+ skip=+^"+ end=+"+ contains=rebolSpecialCharactersyn region rebolString start=+[^#]{+ end=+}+ skip=+{[^}]*}+ contains=rebolSpecialCharacter" Binarysyn region rebolBinary start=+\d*#{+ end=+}+ contains=rebolComment" Emailsyn match rebolEmail "\<\k\+@\(\k\+\.\)*\k\+\>"" Filesyn match rebolFile "%\(\k\+/\)*\k\+[/]\=" contains=rebolSpecialCharactersyn region rebolFile oneline start=+%"+ end=+"+ contains=rebolSpecialCharacter" URLssyn match rebolURL "http://\k\+\(\.\k\+\)*\(:\d\+\)\=\(/\(\k\+/\)*\(\k\+\)\=\)*"syn match rebolURL "file://\k\+\(\.\k\+\)*/\(\k\+/\)*\k\+"syn match rebolURL "ftp://\(\k\+:\k\+@\)\=\k\+\(\.\k\+\)*\(:\d\+\)\=/\(\k\+/\)*\k\+"syn match rebolURL "mailto:\k\+\(\.\k\+\)*@\k\+\(\.\k\+\)*"" Issuessyn match rebolIssue "#\(\d\+-\)*\d\+"" Tuplessyn match rebolTuple "\(\d\+\.\)\{2,}"" Characterssyn match rebolSpecialCharacter contained "\^[^[:space:][]"syn match rebolSpecialCharacter contained "%\d\+"" Operators" Math operatorssyn match rebolMathOperator "\(\*\{1,2}\|+\|-\|/\{1,2}\)"syn keyword rebolMathFunction abs absolute add arccosine arcsine arctangent cosinesyn keyword rebolMathFunction divide exp log-10 log-2 log-e max maximum minsyn keyword rebolMathFunction minimum multiply negate power random remainder sinesyn keyword rebolMathFunction square-root subtract tangent" Binary operatorssyn keyword rebolBinaryOperator complement and or xor ~" Logic operatorssyn match rebolLogicOperator "[<>=]=\="syn match rebolLogicOperator "<>"syn keyword rebolLogicOperator notsyn keyword rebolLogicFunction all anysyn keyword rebolLogicFunction head? tail?syn keyword rebolLogicFunction negative? positive? zero? even? odd?syn keyword rebolLogicFunction binary? block? char? date? decimal? email? empty?syn keyword rebolLogicFunction file? found? function? integer? issue? logic? money?syn keyword rebolLogicFunction native? none? object? paren? path? port? series?syn keyword rebolLogicFunction string? time? tuple? url? word?syn keyword rebolLogicFunction exists? input? same? value?" Datatypessyn keyword rebolType binary! block! char! date! decimal! email! file!syn keyword rebolType function! integer! issue! logic! money! native!syn keyword rebolType none! object! paren! path! port! string! time!syn keyword rebolType tuple! url! word!syn keyword rebolTypeFunction type?" Control statementssyn keyword rebolStatement break catch exit halt reduce return shieldsyn keyword rebolConditional if elsesyn keyword rebolRepeat for forall foreach forskip loop repeat while until do" Series statementssyn keyword rebolStatement change clear copy fifth find first format fourth freesyn keyword rebolStatement func function head insert last match next parse pastsyn keyword rebolStatement pick remove second select skip sort tail third trim length?" Contextsyn keyword rebolStatement alias bind use" Objectsyn keyword rebolStatement import make make-object rebol info?" I/O statementssyn keyword rebolStatement delete echo form format import input load mold prinsyn keyword rebolStatement print probe read save secure send writesyn keyword rebolOperator size? modified?" Debug statementsyn keyword rebolStatement help probe trace" Misc statementssyn keyword rebolStatement func function free" Constantssyn keyword rebolConstant none" 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_rebol_syntax_inits") if version < 508 let did_rebol_syntax_inits = 1 command -nargs=+ HiLink hi link <args> else command -nargs=+ HiLink hi def link <args> endif HiLink rebolTodo Todo HiLink rebolStatement Statement HiLink rebolLabel Label HiLink rebolConditional Conditional HiLink rebolRepeat Repeat HiLink rebolOperator Operator HiLink rebolLogicOperator rebolOperator HiLink rebolLogicFunction rebolLogicOperator HiLink rebolMathOperator rebolOperator HiLink rebolMathFunction rebolMathOperator HiLink rebolBinaryOperator rebolOperator HiLink rebolBinaryFunction rebolBinaryOperator HiLink rebolType Type HiLink rebolTypeFunction rebolOperator HiLink rebolWord Identifier HiLink rebolWordPath rebolWord HiLink rebolFunction Function HiLink rebolCharacter Character HiLink rebolSpecialCharacter SpecialChar HiLink rebolString String HiLink rebolNumber Number HiLink rebolInteger rebolNumber HiLink rebolDecimal rebolNumber HiLink rebolTime rebolNumber HiLink rebolDate rebolNumber HiLink rebolMoney rebolNumber HiLink rebolBinary rebolNumber HiLink rebolEmail rebolString HiLink rebolFile rebolString HiLink rebolURL rebolString HiLink rebolIssue rebolNumber HiLink rebolTuple rebolNumber HiLink rebolFloat Float HiLink rebolBoolean Boolean HiLink rebolConstant Constant HiLink rebolComment Comment HiLink rebolError Error delcommand HiLinkendifif exists("my_rebol_file") if file_readable(expand(my_rebol_file)) execute "source " . my_rebol_file endifendiflet b:current_syntax = "rebol"" vim: ts=8
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -