nvim: Update conform config
This commit is contained in:
parent
b355434763
commit
3dffd94315
@ -1,28 +1,10 @@
|
|||||||
return {
|
return {
|
||||||
"stevearc/conform.nvim",
|
"stevearc/conform.nvim",
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
config = function()
|
config = function(_, opts)
|
||||||
local conform = require("conform")
|
local conform = require("conform")
|
||||||
|
|
||||||
conform.setup({
|
conform.setup(opts)
|
||||||
formatters_by_ft = {
|
|
||||||
css = { "prettier" },
|
|
||||||
go = { "gofumpt" },
|
|
||||||
graphql = { "prettier" },
|
|
||||||
html = { "prettier" },
|
|
||||||
javascript = { "prettier" },
|
|
||||||
json = { "prettier" },
|
|
||||||
liquid = { "prettier" },
|
|
||||||
lua = { "stylua" },
|
|
||||||
markdown = { "prettier" },
|
|
||||||
php = { "phpcbf" },
|
|
||||||
python = { "isort", "black" },
|
|
||||||
sql = { "sqruff" },
|
|
||||||
svelte = { "prettier" },
|
|
||||||
typescript = { "prettier" },
|
|
||||||
yaml = { "prettier" },
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.keymap.set({ "n", "v" }, "<leader>mp", function()
|
vim.keymap.set({ "n", "v" }, "<leader>mp", function()
|
||||||
conform.format({
|
conform.format({
|
||||||
@ -32,4 +14,23 @@ return {
|
|||||||
})
|
})
|
||||||
end, { desc = "Format file or range (in visual mode)" })
|
end, { desc = "Format file or range (in visual mode)" })
|
||||||
end,
|
end,
|
||||||
|
opts = {
|
||||||
|
formatters_by_ft = {
|
||||||
|
css = { "prettier" },
|
||||||
|
go = { "gofumpt" },
|
||||||
|
graphql = { "prettier" },
|
||||||
|
html = { "prettier" },
|
||||||
|
javascript = { "prettier" },
|
||||||
|
json = { "prettier" },
|
||||||
|
liquid = { "prettier" },
|
||||||
|
lua = { "stylua" },
|
||||||
|
markdown = { "prettier" },
|
||||||
|
php = { "phpcbf" },
|
||||||
|
python = { "isort", "black" },
|
||||||
|
sql = { "sqruff" },
|
||||||
|
svelte = { "prettier" },
|
||||||
|
typescript = { "prettier" },
|
||||||
|
yaml = { "prettier" },
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user