📄 lua.vim
字号:
" Vim syntax file" Language: Lua" Author: Carlos Augusto Teixeira Mendes <cmendes@inf.puc-rio.br>" Last Change: 09 october 1998"" Still has some syncing problems..." 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 match"Commentssyn keyword luaTodo contained TODO FIXME XXXsyn match luaComment "--.*$" contains=luaTodo"catch errors caused by wrong parenthesis and wrong curly brackets or"keywords placed outside their respective blockssyn region luaParen transparent start='(' end=')' contains=ALLBUT,luaError,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaCondStart,luaBlock,luaRepeatBlock,luaStatementsyn match luaError ")"syn match luaError "}"syn match luaError "\<\(end\|else\|elseif\|then\|until\)\>""Function declarationsyn region luaFunctionBlock transparent matchgroup=luaFunction start="\<function\>" end="\<end\>" contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd"if then else elseif endsyn keyword luaCond contained elsesyn region luaCondEnd contained transparent matchgroup=luaCond start="\<then\>" end="\<end\>" contains=ALLBUT,luaTodo,luaSpecialsyn region luaCondElseif contained transparent matchgroup=luaCond start="\<elseif\>" end="\<then\>" contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEndsyn region luaCondStart transparent matchgroup=luaCond start="\<if\>" end="\<then\>"me=e-4 contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd nextgroup=luaCondEnd skipwhite skipempty" do end blocksyn region luaBlock transparent matchgroup=luaStatement start="\<do\>" end="\<end\>" contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd"repeat until and while do blockssyn region luaRepeatBlock transparent matchgroup=luaRepeat start="\<repeat\>" end="\<until\>" contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEndsyn region luaRepeatBlock transparent matchgroup=luaRepeat start="\<while\>" end="\<do\>"me=e-2 contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd nextgroup=luaBlock skipwhite skipempty"other keywordssyn keyword luaStatement return localsyn keyword luaOperator and or notsyn keyword luaConstant nil"Pre processorsyn match luaPreProc "^\s*$\(debug\|nodebug\|if\|ifnot\|end\|else\|endinput\)\>""Stringssyn match luaSpecial contained "\\[ntr]"syn region luaString start=+'+ end=+'+ skip=+\\\\\|\\'+ contains=luaSpecialsyn region luaString start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=luaSpecialsyn region luaString start=+\[\[+ end=+\]\]+"integer numbersyn match luaNumber "\<[0-9]\+\>""floating point number, with dot, optional exponentsyn match luaFloat "\<[0-9]\+\.[0-9]*\(e[-+]\=[0-9]\+\)\=\>""floating point number, starting with a dot, optional exponentsyn match luaFloat "\.[0-9]\+\(e[-+]\=[0-9]\+\)\=\>""floating point number, without dot, with exponentsyn match luaFloat "\<[0-9]\+e[-+]\=[0-9]\+\>""tablessyn region luaTableBlock transparent matchgroup=luaTable start="{" end="}" contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaCondStart,luaBlock,luaRepeatBlock,luaStatement"internal functionssyn keyword luaInternalFunc assert call collectgarbage dofile copytagmethodssyn keyword luaInternalFunc dostring error foreach foreachvar getglobalsyn keyword luaInternalFunc newtag next nextvar print rawgetglobalsyn keyword luaInternalFunc rawgettable rawsetglobal rawsettable seterrormethodsyn keyword luaInternalFunc setglobal settagmethod gettagmethod settag tonumbersyn keyword luaInternalFunc tostring tag type"standard librariessyn keyword luaStdLibFunc setlocale execute remove rename tmpnamesyn keyword luaStdLibFunc getenv date clock exit debug print_stacksyn keyword luaStdLibFunc readfrom writeto appendto read writesyn keyword luaStdLibFunc abs sin cos tan asinsyn keyword luaStdLibFunc acos atan atan2 ceil floorsyn keyword luaStdLibFunc mod frexp ldexp sqrt min max logsyn keyword luaStdLibFunc log10 exp deg rad randomsyn keyword luaStdLibFunc randomseed strlen strsub strlower struppersyn keyword luaStdLibFunc strchar strrep ascii strbyte formatsyn keyword luaStdLibFunc strfind gsub"syncing methodsyn sync minlines=100" 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_lua_syntax_inits") if version < 508 let did_lua_syntax_inits = 1 command -nargs=+ HiLink hi link <args> else command -nargs=+ HiLink hi def link <args> endif HiLink luaStatement Statement HiLink luaRepeat Repeat HiLink luaString String HiLink luaNumber Number HiLink luaFloat Float HiLink luaOperator Operator HiLink luaConstant Constant HiLink luaCond Conditional HiLink luaFunction Function HiLink luaComment Comment HiLink luaTodo Todo HiLink luaTable Structure HiLink luaError Error HiLink luaSpecial SpecialChar HiLink luaPreProc PreProc HiLink luaInternalFunc Identifier HiLink luaStdLibFunc Identifier delcommand HiLinkendiflet b:current_syntax = "lua"" vim: ts=8
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -