feat(nvim): update to v0.11

This commit is contained in:
Oliver
2025-10-21 17:09:58 +02:00
parent 3230e6d872
commit eddb023767
8 changed files with 163 additions and 144 deletions

View File

@@ -1,40 +1,34 @@
return {
"stevearc/conform.nvim",
event = "BufWritePre",
event = { "BufReadPre", "BufNewFile" },
opts = {
lsp_fallback = true,
formatters_by_ft = {
lua = { "stylua" },
javascript = { "prettier" },
typescript = { "prettier" },
json = { "prettier" },
css = { "prettier" },
html = { "prettier" },
sh = { "shfmt" },
go = { "goimports", "gofumpt" },
php = { "php-cs-fixer" },
python = { "black" },
},
-- format_on_save = function(bufnr)
-- local filetype = vim.bo[bufnr].filetype
-- if filetype == "javascript" then
-- return nil
-- end
-- if filetype == "vue" then
-- return nil
-- end
-- if filetype == "less" then
-- return nil
-- end
-- if filetype == "php" then
-- return nil
-- end
--
-- return {
-- timeout_ms = 500,
-- lsp_fallback = true,
-- }
-- end,
format_on_save = false,
default_format_opts = { lsp_fallback = true },
},
config = function(_, opts)
require("conform").setup(opts)
-- manual formatting keymap
vim.keymap.set({ "n", "x" }, "=", function()
require("conform").format({
async = true,
lsp_fallback = true,
})
end, { desc = "Format file or range" })
end,
}