Using the Stylua Lua Formatter

Find Tips and tricks on how to better use the Zeus IDE. Feel free to post your own tips but please do not post bug reports, feature requests or questions here.
Post Reply
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Using the Stylua Lua Formatter

Post by jussij »

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:

Code: Select all

      Program Type: (o) Executable
         Menu Text: StyLua
      Program Name: StyLua.exe
         Arguments: "$fn"
 Working Directory: $fdd
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:
stylua.png
stylua.png (138.29 KiB) Viewed 14 times
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
Post Reply