replace == with conform

This commit is contained in:
hyper
2024-10-06 16:25:01 +08:00
parent 98c76f67f2
commit e31646dcf0
2 changed files with 12 additions and 1 deletions
+11 -1
View File
@@ -51,7 +51,8 @@ return {
'stevearc/conform.nvim',
opts = {},
config = function()
require("conform").setup({
local conform = require('conform')
conform.setup({
formatters_by_ft = {
-- lua = { "stylua" },
-- Conform will run multiple formatters sequentially
@@ -66,6 +67,15 @@ return {
html = { "prettierd" },
},
})
vim.keymap.set("n", "==", function()
conform.format({async = true, lsp_format = "fallback"})
end, { desc = "Conform format" })
vim.keymap.set("v", "=", function()
conform.format({async = true, lsp_format = "fallback"})
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<Esc>", true, false, true), "n", true)
end, { desc = "Conform format" })
end
}