Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb72472c

Browse files
committed
some color tweaks, rest of lua syntax and lua bifs
1 parent8cebbbb commitb72472c

File tree

1 file changed

+131
-19
lines changed

1 file changed

+131
-19
lines changed

‎syntax/moon.vim‎

Lines changed: 131 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,124 @@ syn match moonKeyword /\<\%(export\|import\|from\|with\|in\|and\|or\|not\|class\
3737
\display
3838
hideflinkmoonKeywordKeyword
3939

40-
" bifs
41-
syntaxmatchmoonBif/\<\%(table\.insert\|table\.concat\|module\|package\.seeall\|require\|print\|pairs\|ipairs\|rawset\|rawget\)\>/
40+
" all built in funcs from Lua 5.1
41+
synkeywordmoonLuaFunc assert collectgarbage dofile error next
42+
synkeywordmoonLuaFunc print rawget rawset tonumber tostring type _VERSION
43+
synkeywordmoonLuaFunc _G getfenv getmetatable ipairs loadfile
44+
synkeywordmoonLuaFunc loadstring pairs pcall rawequal
45+
synkeywordmoonLuaFunc require setfenv setmetatable unpack xpcall
46+
synkeywordmoonLuaFunc load module select
47+
synmatchmoonLuaFunc/package\.cpath/
48+
synmatchmoonLuaFunc/package\.loaded/
49+
synmatchmoonLuaFunc/package\.loadlib/
50+
synmatchmoonLuaFunc/package\.path/
51+
synmatchmoonLuaFunc/package\.preload/
52+
synmatchmoonLuaFunc/package\.seeall/
53+
synmatchmoonLuaFunc/coroutine\.running/
54+
synmatchmoonLuaFunc/coroutine\.create/
55+
synmatchmoonLuaFunc/coroutine\.resume/
56+
synmatchmoonLuaFunc/coroutine\.status/
57+
synmatchmoonLuaFunc/coroutine\.wrap/
58+
synmatchmoonLuaFunc/coroutine\.yield/
59+
synmatchmoonLuaFunc/string\.byte/
60+
synmatchmoonLuaFunc/string\.char/
61+
synmatchmoonLuaFunc/string\.dump/
62+
synmatchmoonLuaFunc/string\.find/
63+
synmatchmoonLuaFunc/string\.len/
64+
synmatchmoonLuaFunc/string\.lower/
65+
synmatchmoonLuaFunc/string\.rep/
66+
synmatchmoonLuaFunc/string\.sub/
67+
synmatchmoonLuaFunc/string\.upper/
68+
synmatchmoonLuaFunc/string\.format/
69+
synmatchmoonLuaFunc/string\.gsub/
70+
synmatchmoonLuaFunc/string\.gmatch/
71+
synmatchmoonLuaFunc/string\.match/
72+
synmatchmoonLuaFunc/string\.reverse/
73+
synmatchmoonLuaFunc/table\.maxn/
74+
synmatchmoonLuaFunc/table\.concat/
75+
synmatchmoonLuaFunc/table\.sort/
76+
synmatchmoonLuaFunc/table\.insert/
77+
synmatchmoonLuaFunc/table\.remove/
78+
synmatchmoonLuaFunc/math\.abs/
79+
synmatchmoonLuaFunc/math\.acos/
80+
synmatchmoonLuaFunc/math\.asin/
81+
synmatchmoonLuaFunc/math\.atan/
82+
synmatchmoonLuaFunc/math\.atan2/
83+
synmatchmoonLuaFunc/math\.ceil/
84+
synmatchmoonLuaFunc/math\.sin/
85+
synmatchmoonLuaFunc/math\.cos/
86+
synmatchmoonLuaFunc/math\.tan/
87+
synmatchmoonLuaFunc/math\.deg/
88+
synmatchmoonLuaFunc/math\.exp/
89+
synmatchmoonLuaFunc/math\.floor/
90+
synmatchmoonLuaFunc/math\.log/
91+
synmatchmoonLuaFunc/math\.log10/
92+
synmatchmoonLuaFunc/math\.max/
93+
synmatchmoonLuaFunc/math\.min/
94+
synmatchmoonLuaFunc/math\.fmod/
95+
synmatchmoonLuaFunc/math\.modf/
96+
synmatchmoonLuaFunc/math\.cosh/
97+
synmatchmoonLuaFunc/math\.sinh/
98+
synmatchmoonLuaFunc/math\.tanh/
99+
synmatchmoonLuaFunc/math\.pow/
100+
synmatchmoonLuaFunc/math\.rad/
101+
synmatchmoonLuaFunc/math\.sqrt/
102+
synmatchmoonLuaFunc/math\.frexp/
103+
synmatchmoonLuaFunc/math\.ldexp/
104+
synmatchmoonLuaFunc/math\.random/
105+
synmatchmoonLuaFunc/math\.randomseed/
106+
synmatchmoonLuaFunc/math\.pi/
107+
synmatchmoonLuaFunc/io\.stdin/
108+
synmatchmoonLuaFunc/io\.stdout/
109+
synmatchmoonLuaFunc/io\.stderr/
110+
synmatchmoonLuaFunc/io\.close/
111+
synmatchmoonLuaFunc/io\.flush/
112+
synmatchmoonLuaFunc/io\.input/
113+
synmatchmoonLuaFunc/io\.lines/
114+
synmatchmoonLuaFunc/io\.open/
115+
synmatchmoonLuaFunc/io\.output/
116+
synmatchmoonLuaFunc/io\.popen/
117+
synmatchmoonLuaFunc/io\.read/
118+
synmatchmoonLuaFunc/io\.tmpfile/
119+
synmatchmoonLuaFunc/io\.type/
120+
synmatchmoonLuaFunc/io\.write/
121+
synmatchmoonLuaFunc/os\.clock/
122+
synmatchmoonLuaFunc/os\.date/
123+
synmatchmoonLuaFunc/os\.difftime/
124+
synmatchmoonLuaFunc/os\.execute/
125+
synmatchmoonLuaFunc/os\.exit/
126+
synmatchmoonLuaFunc/os\.getenv/
127+
synmatchmoonLuaFunc/os\.remove/
128+
synmatchmoonLuaFunc/os\.rename/
129+
synmatchmoonLuaFunc/os\.setlocale/
130+
synmatchmoonLuaFunc/os\.time/
131+
synmatchmoonLuaFunc/os\.tmpname/
132+
synmatchmoonLuaFunc/debug\.debug/
133+
synmatchmoonLuaFunc/debug\.gethook/
134+
synmatchmoonLuaFunc/debug\.getinfo/
135+
synmatchmoonLuaFunc/debug\.getlocal/
136+
synmatchmoonLuaFunc/debug\.getupvalue/
137+
synmatchmoonLuaFunc/debug\.setlocal/
138+
synmatchmoonLuaFunc/debug\.setupvalue/
139+
synmatchmoonLuaFunc/debug\.sethook/
140+
synmatchmoonLuaFunc/debug\.traceback/
141+
synmatchmoonLuaFunc/debug\.getfenv/
142+
synmatchmoonLuaFunc/debug\.getmetatable/
143+
synmatchmoonLuaFunc/debug\.getregistry/
144+
synmatchmoonLuaFunc/debug\.setfenv/
145+
synmatchmoonLuaFunc/debug\.setmetatable/
146+
147+
hideflinkmoonLuaFuncIdentifier
42148

43149
" The first case matches symbol operators only if they have an operand before.
44-
" need to put \ here
45150
synmatchmoonExtendedOp/\%(\S\s*\)\@<=[+\-*/%&|\^=!<>?]\+\|\.\|\\\|!/
46151
\display
47152
hideflinkmoonExtendedOpmoonOperator
48153
hideflinkmoonOperatorOperator
49154

155+
syntaxmatchmoonFunction/->\|=>\|)\|(\|\[\|]\|{\|}/
156+
highlightdefaultlinkmoonFunctionFunction
157+
50158
" This is separate from `moonExtendedOp` to help differentiate commas from
51159
" dots.
52160
synmatchmoonSpecialOp/[,;]/display
@@ -62,7 +170,7 @@ hi def link moonGlobal Type
62170
synmatchmoonSpecialVar/\<\%(self\)\>/display
63171
" An @-variable
64172
synmatchmoonSpecialVar/@\%(\I\i*\)\?/display
65-
hideflinkmoonSpecialVarSpecial
173+
hideflinkmoonSpecialVarStructure
66174

67175
" A class-like name that starts with a capital letter
68176
synmatchmoonObject/\<\u\w*\>/display
@@ -88,6 +196,10 @@ syn region moonString start=/'/ skip=/\\\\\|\\'/ end=/'/
88196
\ contains=@moonBasicString
89197
hideflinkmoonStringString
90198

199+
synregionmoonString2matchgroup=moonStringstart="\[\z(=*\)\["end="\]\z1\]"contains=@Spell
200+
hideflinkmoonString2String
201+
202+
91203
" A integer, including a leading plus or minus
92204
synmatchmoonNumber/\i\@<![-+]\?\d\+\%([eE][+-]\?\d\+\)\?/display
93205
" A hex number
@@ -174,30 +286,30 @@ hi def link moonDotAccess moonExtendedOp
174286
synmatchmoonProtoAccess/::\s*\I\i*/he=s+2contains=@moonIdentifier
175287
hideflinkmoonProtoAccessmoonExtendedOp
176288

177-
" This is required for interpolations to work.
178-
synregionmoonCurliesmatchgroup=moonCurlystart=/{/end=/}/
179-
\ contains=@moonAll
180-
synregionmoonBracketsmatchgroup=moonBracketstart=/\[/end=/\]/
181-
\ contains=@moonAll
182-
synregionmoonParensmatchgroup=moonParenstart=/(/end=/)/
183-
\ contains=@moonAll
184-
185-
" These are highlighted the same as commas since they tend to go together.
186-
hideflinkmoonBlockmoonSpecialOp
187-
hideflinkmoonBracketmoonBlock
188-
hideflinkmoonCurlymoonBlock
189-
hideflinkmoonParenmoonBlock
289+
""This is required for interpolations to work.
290+
"syn region moonCurlies matchgroup=moonCurly start=/{/ end=/}/
291+
"\ contains=@moonAll
292+
"syn region moonBrackets matchgroup=moonBracket start=/\[/ end=/\]/
293+
"\ contains=@moonAll
294+
"syn region moonParens matchgroup=moonParen start=/(/ end=/)/
295+
"\ contains=@moonAll
296+
"
297+
""These are highlighted the same as commas since they tend to go together.
298+
"hi def link moonBlock moonSpecialOp
299+
"hi def link moonBracket moonBlock
300+
"hi def link moonCurly moonBlock
301+
"hi def link moonParen moonBlock
190302

191303
" This is used instead of TOP to keep things moon-specific for good
192304
" embedding. `contained` groups aren't included.
193305
synclustermoonAllcontains=moonStatement,moonRepeat,moonConditional,
194-
\ moonKeyword,moonOperator,
306+
\ moonKeyword,moonOperator,moonFunction,
195307
\ moonExtendedOp,moonSpecialOp,moonBoolean,
196308
\ moonGlobal,moonSpecialVar,moonObject,
197309
\ moonConstant,moonString,moonNumber,
198310
\ moonFloat,moonReservedError,moonObjAssign,
199311
\ moonObjStringAssign,moonObjNumberAssign,
200-
\ moonComment,
312+
\ moonComment,moonLuaFunc,
201313
\ moonSpaceError,moonSemicolonError,
202314
\ moonDotAccess,moonProtoAccess,
203315
\ moonCurlies,moonBrackets,moonParens

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp