A NetLinx major mode for Emacs using Tree-Sitter.
- Syntax highlighting via tree-sitter
- Automatic grammar installation
- Built on Emacs 29+ native tree-sitter support
- Emacs 29.1 or later with tree-sitter support
- C compiler (gcc/clang) for building the grammar
- Git (for downloading the grammar)
(use-package netlinx-mode
:ensure t
:mode ("\\.axs\\'" "\\.axi\\'"))- Clone this repository:
git clone https://github.com/Norgate-AV/emacs-netlinx-mode.git- Add to your Emacs configuration:
(add-to-list 'load-path "/path/to/emacs-netlinx-mode")
(require 'netlinx-mode)The mode will automatically activate for .axs and .axi files. When you first open a NetLinx file, the tree-sitter grammar will be automatically downloaded and compiled.
If automatic installation fails, you can manually install the grammar:
M-x netlinx-mode--install-grammarYou can customize the grammar repository location:
(setq netlinx-mode-grammar-location "https://github.com/Norgate-AV/tree-sitter-netlinx")This mode uses the built-in treesit.el library (Emacs 29+) and the tree-sitter-netlinx grammar.
- Load the mode in Emacs:
(load-file "/path/to/netlinx-mode.el")-
Open a NetLinx file to test syntax highlighting
-
Use
M-x treesit-explore-modeto inspect the parse tree