From f7bbc5e6740f6199d7ed0fe704daaa7efd98c093 Mon Sep 17 00:00:00 2001 From: Tom Li Dobnik Date: Tue, 3 Mar 2026 18:46:16 +0100 Subject: nvim update --- .config/nvim-old/lua/config/plugins/conform.lua | 40 +++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .config/nvim-old/lua/config/plugins/conform.lua (limited to '.config/nvim-old/lua/config/plugins/conform.lua') diff --git a/.config/nvim-old/lua/config/plugins/conform.lua b/.config/nvim-old/lua/config/plugins/conform.lua new file mode 100644 index 0000000..5747200 --- /dev/null +++ b/.config/nvim-old/lua/config/plugins/conform.lua @@ -0,0 +1,40 @@ +return { + "stevearc/conform.nvim", + event = "VeryLazy", + keys = { + { + "f", + function() + require("conform").format({ async = true, lsp_format = "fallback" }) + end, + mode = "", + desc = "Format buffer", + }, + }, + + opts = { + formatters_by_ft = { + lua = { "stylua" }, + python = { "isort", "black" }, + rust = { "rustfmt" }, + javascript = { "prettierd", "prettier", stop_after_first = true }, + typescript = { "prettierd", "prettier", stop_after_first = true }, + typescriptreact = { "prettierd", "prettier", stop_after_first = true }, + css = { "prettierd", "prettier", stop_after_first = true }, + html = { "prettierd", "prettier", stop_after_first = true }, + typst = { "prettypst" }, + xml = { "xmlformatter" }, + }, + format_on_save = { + timeout_ms = 500, + lsp_format = "fallback", + }, + formatters = { + xmlformat = { + command = "xmlformat", + args = { "--selfclose", "-" }, + stdin = true, + }, + }, + }, +} -- cgit v1.2.3