GMod Lua syntax highlighters
From GMod Wiki
Go to: Development Tools |
Contents |
Summary
Lua in its implementation in GMod differs slightly from that of standard Lua.
For those fussy people who would rather have their GMod Lua code highlighted properly (e.g. when they're using C-style comments), below is a list of custom highlighters available for some commom text editors to provide GMod Lua highlighting for GMod Lua scripts such as SWEPs.
PSPad
Download PSPad_Gmod Lua.zip (424 bytes)
Follow these steps to set up the GMod Lua highlighter with PSPad.
- Close PSPad if open and extract the contents of the archive (GMod Lua.INI) to the /Syntax subfolder of your PSPad installation path.
- Run PSPad. Point to Settings --> Highlighter Settings.
- In the Highlighter Settings dialog; browse throught the left-pane list of languages and check a placholder field ("<not assigned>").
- Check the checkbox for the field. Click on the Specification tab in the right pane.
- In the right pane, under User Highlighters - scroll through the list of available language highlighters until you come to "GMod Lua". Select it.
- Click Apply and then OK.
- Open a GMod Lua file such as a SWEP file. If you don't have (standard) Lua highlighting enabled, GMod Lua highlighting should already be applied. Otherwise on the Change document syntax highlight toolbar button (the one which in PSPad's default theme looks like a Visual Studio logo with "C++" written above it). In the list, choose "GMod Lua". Click OK and GMod Lua highlighting should be instantly applied.
NOTE: If you wish to also have the standard Lua highlighter enabled at the same time, following the instruction outlined in the last step will be a necessity everytime you want to highlight code GMod Lua style. |
jEdit
Download jEdit_Gmod Lua.zip (1.91 KB)
Follow these steps to set up the GMod Lua highlighter with jEdit.
- Close jEdit if open and extract the contents of the archive (gmodlua.xml) to the /modes subfolder of your jEdit installation path.
- Open the "catalog" file (found in the /modes subfolder) with jEdit.
- In the file, add this code somewhere between the
<MODE>
and</MODE>
tags:
<MODE NAME="GMod Lua" FILE="gmodlua.xml" FILE_NAME_GLOB="*.lua" />
- Locate this code either commenting it out with XML comments ( ) or by changing the file extension to something else other than Lua, so it does not conflict with the GMod higlighting:
<MODE NAME="lua" FILE="lua.xml" FILE_NAME_GLOB="*.lua" />
NOTE: If you choose the extension changing solution for this step. Make sure you use an extension that will not conflict with any other language highlighting you may want to still use. |
- Save all changes made to the "catalog" file and close jEdit.
- Run jEdit and open one of your GMod Lua files. If all is well, you file should now be correctly highlighted GMod Lua style.
Other Editors
Below are GMod Lua highlighter files for other text editors which as yet do not have any instructions for their use on this wiki.