Neovim plugin for the Odin programming language.
The plugin provides:
- build/test/format commands
- per-project overrides for build/test commands
- build errors in quickfix list
- format-on-save
- Tree-sitter folding
- optional ols workspace folders for the Odin standard library
- optional Telescope pickers for project and standard library Odin symbols
- bundled LLDB formatters for Odin
- health check
See doc/odin.nvim.txt for detailed plugin documentation.
- Neovim 0.12 or newer
- lazy.nvim
Using lazy.nvim:
{
"cephei8/odin.nvim",
lazy = false,
opts = {},
}| Command | Description |
|---|---|
| :Odin build | Runs the configured build command |
| :Odin test | Runs the configured test command |
| :Odin fmt | Formats the current buffer using odinfmt tool |
Use vim.opt.exrc = true + per-project .nvim.lua files.
In the project's .nvim.lua file override build/test commands:
require("odin").setup({
commands = {
build = { "odin", "build", ".", "-debug" },
test = { "odin", "test", ".", "-define:ODIN_TEST_SHORT_LOGS=true" },
},
})Commands run from the detected project root.
If Telescope is installed, odin.nvim loads its optional extension during setup. You can also load it manually:
require("telescope").load_extension("odin")To disable automatic loading:
require("odin").setup({
telescope = {
load_extension = false,
},
})Available pickers:
| Picker | Description |
|---|---|
| :Telescope odin project_symbols | Shows workspace symbols under the current Odin project root |
| :Telescope odin stdlib_symbols | Shows workspace symbols from the Odin standard library |
The following is not provided by the plugin, but is needed for a full Odin programming setup:
- syntax highlighting
- LSP setup
- autocomplete
- debugging setup
Check out this blog post on how to set it up: Neovim setup for Odin.
This project is licensed under the terms of the MIT License.