A Vim and Neovim plugin to give native-feeling support for the Odin programming language. Features include: syntax highlighting, proper indenting, :compiler odin to have quickfix error handling, and [[/]] to jump between functions.
The highlighting has been made to very closely match Sublime's Odin highlighting (at least as much as possible given the editor differences). The syntax file and highlight groups should be very easy to read/modify/override for your preferences (there are some disabled optionals such as highlights for constant declarations, for example).
Written entirely in vimscript, so will work with Vim, as well as Neovim.
- The ftplugin and indent files are almost 1:1 translated to old vimscript from habamax/vim-odin, which is builtin to recent versions of both Vim and Neovim.
- The syntax file was forked from Tetralux/odin.vim, which was derived from jansedivy/jai.vim.
- A few bits and ideas for syntax were used from mindhopper/nvim-odin.
- Some organization for syntax inspired by Sublime's Odin syntax definitions
Yes, now there are at least 4 separate odin plugins for vim. You could make the fifth!
- Manual: clone the repo into your vim config plugins folder
- vim-plug:
Plug 'auwsmit/odin4vim' - Neovim 0.12+ builtin:
vim.pack.add({ 'https://github.com/auwsmit/odin4vim' }) - lazy.nvim:
{ 'auwsmit/odin4vim' }
Run :compiler odin in vim to set 'makeprg' to odin build . for that session. Then, running :make will build the current directory and fill the quickfix list with any warnings or errors, which can be quickly navigated with [q/]q.
Font: Fantasque Sans Mono, sans ligatures
catppuccin (comes with Vim v9.2.0219+ and Neovim 0.12+)
habamax (comes with vim/nvim)
- habamax/vim-odin has intentionally very minimal highlighting, but I wanted it to be more like Sublime's.
- Tetralux/odin.vim had simplistic/poor indenting support, no extra features, and the syntax file was pretty dated and disorganized (mostly due to being initially based on jai back in 2017).
- mindhopper/nvim-odin is impressive in its scope and features, but is only for neovim, and in my testing has some false-positives for highlights. It's just a bit "over-opinionated" for me, but again, is also really cool and impressive. You should check it out as an alternative to odin4vim!



