feat(nvim): add mini plugins, smart open and formatting

This commit is contained in:
fbachus
2025-01-10 02:00:20 +01:00
parent 6e9dd516f1
commit 77cb47e4b5
15 changed files with 418 additions and 277 deletions

View File

@@ -0,0 +1,28 @@
require("conform").setup({
vim.api.nvim_create_autocmd({ "BufWritePre", "InsertLeave" }, {
pattern = "*",
callback = function(args)
require("conform").format({ bufnr = args.buf })
end,
}),
formatters_by_ft = {
lua = { "stylua" },
rust = { "rustfmt", lsp_format = "fallback" },
-- Conform will run multiple formatters sequentially
python = { "ruff", "autopep8" },
gdscript = { "gdtoolkit" },
bash = { "shellharden" },
javascript = { "prettier" },
typescript = { "prettier" },
markdown = { "prettier" },
css = { "prettier" },
html = { "prettier" },
json = { "prettier" },
yaml = { "prettier" },
},
format_on_save = {
timeout_ms = 700,
lsp_format = "fallback",
},
log_level = vim.log.levels.DEBUG,
})