FormatLua
Formatting lua to a more readable form by using Lua Development Tools library.
Details
Installs
- Total 16K
- Win 11K
- Mac 3K
- Linux 1K
Aug 9 | Aug 8 | Aug 7 | Aug 6 | Aug 5 | Aug 4 | Aug 3 | Aug 2 | Aug 1 | Jul 31 | Jul 30 | Jul 29 | Jul 28 | Jul 27 | Jul 26 | Jul 25 | Jul 24 | Jul 23 | Jul 22 | Jul 21 | Jul 20 | Jul 19 | Jul 18 | Jul 17 | Jul 16 | Jul 15 | Jul 14 | Jul 13 | Jul 12 | Jul 11 | Jul 10 | Jul 9 | Jul 8 | Jul 7 | Jul 6 | Jul 5 | Jul 4 | Jul 3 | Jul 2 | Jul 1 | Jun 30 | Jun 29 | Jun 28 | Jun 27 | Jun 26 | Jun 25 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 2 | 0 | 0 | 0 | 2 | 0 | 0 | 3 | 3 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 4 | 0 | 2 | 3 | 2 | 1 | 2 | 1 | 0 | 0 | 2 | 2 | 0 | 0 | 1 | 3 | 1 | 1 | 0 | 1 | 3 | 2 | 1 | 1 | 1 | 0 | 0 | 1 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 1 | 0 | 3 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 |
Readme
- Source
- raw.githubusercontent.com
Summary
FormatLua formats lua code to a more readable form by using Lua Development Tools library.
Require
- Lua
Support System
- MacOSX
- Linux
How to Use
- Select lua code and click menu Selection -> Format -> Format Lua Code
- Select lua code and press alt+l
Configure Setting
Setting lua path in FormatLua.sublime-settings
{
"lua_path": "/usr/local/bin/lua"
}
Configure Key Binding
Add the following line to keymap settings
{ "keys": ["alt+l"], "command": "format_lua" }
Example
Original:
local a = "你好"
local b
function set_text(name, value)
local doc = document:getElementsByName(name)
if doc and #doc > 0 then
doc[1]:setPropertyByName("text", value)
end
end
return b
Formated:
local a = "你好"
local b
function set_text(name, value)
local doc = document:getElementsByName(name)
if doc and #doc > 0 then
doc[1]:setPropertyByName("text", value)
end
end
return b