fix(config): new config, it's been a while

This commit is contained in:
devaine 2025-10-26 19:41:13 -05:00
commit 1fe92c532b
Signed by: devaine
GPG key ID: 954B1DCAC6FF84EE
11 changed files with 385 additions and 0 deletions

38
lua/plugins/formatter.lua Normal file
View file

@ -0,0 +1,38 @@
-- Formatter plugin, helps with formatting code on saving the file.
return {
"stevearc/conform.nvim",
event = { "BufWritePre" },
cmd = { "ConformInfo" },
-- This will provide type hinting with LuaLS
---@module "conform"
---@type conform.setupOpts
opts = {
formatters_by_ft = {
lua = { "stylua" },
python = { "black" },
javascript = { "prettier" }, -- add stop_after_first for n > 1
typescript = { "prettier" },
sh = { "shfmt", "shellcheck" },
bash = { "shfmt", "shellcheck" },
},
formatters = {
prettier = {
prepend_args = function()
return { "" }
end,
},
},
default_format_opts = {
lsp_format = "fallback",
},
format_on_save = {
timeout_ms = 500,
},
},
init = function()
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
end,
}