aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authortroi <blametroi@gmail.com>2025-04-14 08:36:13 -0400
committertroi <blametroi@gmail.com>2025-04-14 08:36:13 -0400
commitf89afb34fc0868dd291b1519a15dfcf0dd441ffa (patch)
treed3e11907c9c18dd17326eedb560fdb5065005b17 /README.md
parent8a20fcbc8c4fa720783320ad9ed7900c2d2cddd8 (diff)
update readme for odinvmt-neovim-conform
Diffstat (limited to 'README.md')
-rw-r--r--README.md28
1 files changed, 27 insertions, 1 deletions
diff --git a/README.md b/README.md
index c42f79c..746a665 100644
--- a/README.md
+++ b/README.md
@@ -205,7 +205,7 @@ Configuration of the LSP:
Neovim has a builtin support for LSP.
-There is a plugin that makes the setup easier, called [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig). You can install it with your prefered package manager.
+There is a plugin that makes the setup easier, called [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig). You can install it with your preferred package manager.
A simple configuration that uses the default `ols` settings would be like this:
@@ -226,6 +226,32 @@ require'lspconfig'.ols.setup {
}
```
+Neovim can run Odinfmt on save using the [conform](https://github.com/stevearc/conform.nvim) plugin. Here is a sample configuration using the [lazy.nvim](https://github.com/folke/lazy.nvim) package manager:
+
+```lua
+local M = {
+ "stevearc/conform.nvim",
+ opts = {
+ notify_on_error = false,
+ -- Odinfmt gets its configuration from odinfmt.json. It defaults
+ -- writing to stdout but needs to be told to read from stdin.
+ formatters = {
+ odinfmt = {
+ -- Change where to find the command if it isn't in your path.
+ command = "odinfmt",
+ args = { "-stdin" },
+ stdin = true,
+ },
+ },
+ -- and instruct conform to use odinfmt.
+ formatters_by_ft = {
+ odin = { "odinfmt" },
+ },
+ },
+}
+return M
+```
+
### Emacs
For Emacs, there are two packages available for LSP; lsp-mode and eglot.