From 2edeb4557ce67ad65664a8190b690d2f330840fb Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 5 Dec 2023 13:01:33 +0100 Subject: Refactor conform opts --- fnl/plugins/editor/conform.fnl | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) (limited to 'fnl/plugins') diff --git a/fnl/plugins/editor/conform.fnl b/fnl/plugins/editor/conform.fnl index ed5322f..973d1c4 100644 --- a/fnl/plugins/editor/conform.fnl +++ b/fnl/plugins/editor/conform.fnl @@ -7,26 +7,24 @@ (conform.format {:lsp_fallback true :async true}))) {:desc :Format})) -(fn config [] - (let [conform (require :conform)] - (conform.setup {:formatters {:fnlfmt {:command :fnlfmt - :args [:--fix :$FILENAME] - :stdin false}} - :formatters_by_ft {:* [:codespell] - :_ [:trim_whitespace :trim_newlines] - :css [:stylelint] - :fennel [:fnlfmt] - :haskell [:fourmolu] - :html [:djlint] - :json [:jq] - :lua [:stylua] - :markdown [:prettierd] - :ocaml [:ocamlformat] - :python [:ruff_format] - :rust [:rustfmt] - :sh [:shfmt :shellharden] - :sql [:pg_format :sqlfluff] - :toml [:taplo] - :yaml [:yamlfmt]}}))) +(local opts {:formatters {:fnlfmt {:command :fnlfmt + :args [:--fix :$FILENAME] + :stdin false}} + :formatters_by_ft {:* [:codespell] + :_ [:trim_whitespace :trim_newlines] + :css [:stylelint] + :fennel [:fnlfmt] + :haskell [:fourmolu] + :html [:djlint] + :json [:jq] + :lua [:stylua] + :markdown [:prettierd] + :ocaml [:ocamlformat] + :python [:ruff_format] + :rust [:rustfmt] + :sh [:shfmt :shellharden] + :sql [:pg_format :sqlfluff] + :toml [:taplo] + :yaml [:yamlfmt]}}) -{1 :stevearc/conform.nvim : init : config :event [:BufReadPost :BufNewFile]} +{1 :stevearc/conform.nvim : init : opts :event [:BufReadPost :BufNewFile]} -- cgit v1.2.3-70-g09d2