Using the Stylua Lua Formatter
Posted: Sat Feb 22, 2025 11:57 am
Running StyLua as a Tool Menu Option
1. Download a release executable from the following page: https://github.com/JohnnyMorganz/StyLua/releases
In this case the stylua-windows-x86_64.zip asset was downloaded.
2. Extract the zip file to a suitable folder location, making sure that folder is also found in the system PATH. A good option is to use the Zeus installation folder or the Zeus zGNU folder, as both of these will be found in the PATH. Alternative add the folder to the PATH.
3. Use the Options, Document Type menu and edit the Lua document type
In the Tools section add the following Tool:
IMPORTANT: The program name does not need to be fully qualified because the StyLua.exe is assumed to be in the system PATH.
The rest of the settings should look like this: Running StyLua as a File Save Trigger
The formatter can also be run as a trigger, meaning the file will be automatically formatter each time the file is saved.
For more details on how to do this refer to the following link: https://www.zeusedit.com/phpBB3.1/viewtopic.php?p=13961
Jussi
1. Download a release executable from the following page: https://github.com/JohnnyMorganz/StyLua/releases
In this case the stylua-windows-x86_64.zip asset was downloaded.
2. Extract the zip file to a suitable folder location, making sure that folder is also found in the system PATH. A good option is to use the Zeus installation folder or the Zeus zGNU folder, as both of these will be found in the PATH. Alternative add the folder to the PATH.
3. Use the Options, Document Type menu and edit the Lua document type
In the Tools section add the following Tool:
Code: Select all
Program Type: (o) Executable
Menu Text: StyLua
Program Name: StyLua.exe
Arguments: "$fn"
Working Directory: $fdd
The rest of the settings should look like this: Running StyLua as a File Save Trigger
The formatter can also be run as a trigger, meaning the file will be automatically formatter each time the file is saved.
For more details on how to do this refer to the following link: https://www.zeusedit.com/phpBB3.1/viewtopic.php?p=13961
Jussi