Skip to content

Instantly share code, notes, and snippets.

@wolf81
Last active April 11, 2024 07:33
Show Gist options
  • Save wolf81/9483c2c4d4e79ca800e286c37d6c9cbe to your computer and use it in GitHub Desktop.
Save wolf81/9483c2c4d4e79ca800e286c37d6c9cbe to your computer and use it in GitHub Desktop.
Sublime Text snippet for a Lua class prototype, invoke by typing `class`
<snippet>
<content><![CDATA[
local ${1:ClassName} = {}
$1.new = function()
$0
return setmetatable({
}, $1)
end
return setmetatable($1, {
__call = function(_, ...) return $1.new(...) end,
})
]]></content>
<tabTrigger>class</tabTrigger>
<description>Add a Lua class with private scope.</description>
<scope>source.lua</scope>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment