FormatLua
Formatting lua to a more readable form by using Lua Development Tools library.
Details
Installs
- Total 17K
- Win 12K
- Mac 4K
- Linux 1K
Sep 7 | Sep 6 | Sep 5 | Sep 4 | Sep 3 | Sep 2 | Sep 1 | Aug 31 | Aug 30 | Aug 29 | Aug 28 | Aug 27 | Aug 26 | Aug 25 | Aug 24 | Aug 23 | Aug 22 | Aug 21 | Aug 20 | Aug 19 | Aug 18 | Aug 17 | Aug 16 | Aug 15 | Aug 14 | Aug 13 | Aug 12 | Aug 11 | Aug 10 | 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 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 1 | 0 | 1 | 1 | 0 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Linux | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
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