How to enable syntax highlighting for Odin in Emacs
Date written: 2022.03.08
At the time of writing, Odin is not a popular language. Most people haven't even heard of it. As such, even though a Emacs syntax highlighting file Odin has been made, it isn't part of Emacs. The steps below explain how to enable syntax highlighting in Odin with this file. The steps should be applicable to any syntax highlighting file not turned on by default in Emacs.
Step 1: Download the syntax highlighting file
- Visit the odin-mode repo on github, hosted by mattt-b.
odin-mode.elto somewhere on your computer.
Step 2: Open your .emacs file
- The path to the Emacs file will be on the second line.
C-x C-fthen type / paste in the path.
Step 3: Modify your .emacs file to load the .el file
- Add the line
(load "path-to-syntax-file")to your .emacs file where
path-to-syntax-fileis the path to the
.elfile you downloaded in Step 1.
- Add a comment above the line you added, telling your future self what the line does!
- Test it. Open up a new instance of Emacs on a .odin file... and enjoy automatic syntax highlighting!
I couldn't find a concise description of the steps above in once place, so hopefully whoever is reading this finds it helpful.