From f9f6a4e5b4890663c5458136628dbe2a762637e1 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Mon, 2 Dec 2024 23:25:31 +0100 Subject: [PATCH] formatter updates, something for json --- lua/custom/plugins/init.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 1b8c64a..f979a21 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -31,14 +31,23 @@ return { lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype], } end, + default_format_opts = { + lsp_format = 'fallback', + }, formatters_by_ft = { + fallback = { 'prettier' }, lua = { 'stylua' }, + json = { 'jq', 'biome', 'clang-format', 'prettier' }, + rust = 'rustfmt', + c = 'clang-format', + cpp = 'clang-format', + python = 'autopep8', -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, -- -- You can use a sub-list to tell conform to run *until* a formatter -- is found. - -- javascript = { { "prettierd", "prettier" } }, + javascript = { 'prettierd', 'prettier' }, }, }, },