Nvim: change neoformat to conform and update plugins

This commit is contained in:
Marko Korhonen 2025-06-09 11:42:19 -05:00
parent 7c1ded08bd
commit 861ca9ebaa
4 changed files with 72 additions and 59 deletions

View file

@ -0,0 +1,29 @@
local prettier = { "prettierd", "prettier", stop_after_first = true }
-- Formatter plugin
--- @type LazyPluginSpec
return {
"stevearc/conform.nvim",
event = "VeryLazy",
opts = {
formatters_by_ft = {
lua = { "stylua" },
javascript = prettier,
json = prettier,
python = { "black" },
},
},
keys = {
{
desc = "Format with Conform",
"<leader>f",
function()
require("conform").format()
end,
},
},
config = function(_, opts)
require("conform").setup(opts)
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
end,
}