aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortroi <blametroi@gmail.com>2025-04-05 18:56:08 -0400
committertroi <blametroi@gmail.com>2025-04-05 18:56:08 -0400
commit8a20fcbc8c4fa720783320ad9ed7900c2d2cddd8 (patch)
tree1f72741b02ec22899d4a7235a84ff30dc3de8048
parente47febd40ed0e71aed6bb6bdc4fdce2fe6c2e8fc (diff)
neovim definitions for conform
-rw-r--r--editors/neovim/.stylua.toml6
-rw-r--r--editors/neovim/conform.lua25
2 files changed, 31 insertions, 0 deletions
diff --git a/editors/neovim/.stylua.toml b/editors/neovim/.stylua.toml
new file mode 100644
index 0000000..4d6c566
--- /dev/null
+++ b/editors/neovim/.stylua.toml
@@ -0,0 +1,6 @@
+column_width = 100
+line_endings = "Unix"
+indent_type = "Spaces"
+indent_width = 3
+quote_style = "AutoPreferDouble"
+call_parentheses = "Always"
diff --git a/editors/neovim/conform.lua b/editors/neovim/conform.lua
new file mode 100644
index 0000000..a7aca1a
--- /dev/null
+++ b/editors/neovim/conform.lua
@@ -0,0 +1,25 @@
+-- This is a definition to add to your code formatter in Neovim.
+-- "stevearc/conform.nvim" can be configured to format on save,
+-- here is a definition of odinfmt for conform using the lazy.nvim
+-- plugin manager.
+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