Syntax highlighting and indentation still need a bit more testing and fine tuning, sometimes when writing some egregious Odin code Emacs will crash? lockup? but most of the time it should be fine.
A Major mode for Emacs >= 29.1 powered by tree-sitter for editing odin files.
Emacs >= 29.1 compiled with tree-sitter.
The grammar utilized for this major-mode can be found at https://github.com/tree-sitter-grammars/tree-sitter-odin.
To install it you can add this line to your `treesit-language-source-alist`:
(defvar treesit-language-source-alist
'(...
(odin "https://github.com/tree-sitter-grammars/tree-sitter-odin")
...))Afterwards run M-x treesit-install-language-grammar RET odin RET.
Clone this repo
git clone https://github.com/Sampie159/odin-ts-mode.gitand add this to your init.el file:
(load-file "/path/to/odin-ts-mode.el")You can also use use-package to install this package, simply add this to your init.el file (you can skip the usage step below with this):
(use-package odin-ts-mode
:ensure (:host github :repo "Sampie159/odin-ts-mode")
:mode "\\.odin\\'")Add this to your configuration:
(add-to-list 'auto-mode-alist '("\\.odin\\'" . odin-ts-mode))- [-] Syntax Highlighting [1/2]
- [X] Get something working
- [ ] Make things prettier
- [X] Indentation [2/2]
- [X] Get something working
- [X] Make sure everything is good
- [X] Imenu