Format html using dprint
This commit is contained in:
parent
765eaca023
commit
173c23b107
|
@ -4,7 +4,6 @@ require("formatter").setup({
|
|||
go = {
|
||||
require("formatter.filetypes.go").gofmt,
|
||||
require("formatter.filetypes.go").goimports,
|
||||
|
||||
},
|
||||
|
||||
lua = {
|
||||
|
@ -14,17 +13,30 @@ require("formatter").setup({
|
|||
python = {
|
||||
require("formatter.filetypes.python").black,
|
||||
require("formatter.filetypes.python").isort,
|
||||
|
||||
},
|
||||
|
||||
rust = {
|
||||
require("formatter.filetypes.rust").rustfmt,
|
||||
},
|
||||
|
||||
html = {
|
||||
function()
|
||||
local util = require "formatter.util"
|
||||
return {
|
||||
exe = "dprint",
|
||||
args = {
|
||||
"fmt",
|
||||
util.escape_path(util.get_current_buffer_file_path()),
|
||||
},
|
||||
stdin = false,
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
["*"] = {
|
||||
require("formatter.filetypes.any").remove_trailing_whitespace,
|
||||
},
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_set_keymap("n", "<leader>f", "<cmd>Format<cr>", { silent = true, noremap = true })
|
||||
|
@ -37,4 +49,3 @@ augroup FormatAutogroup
|
|||
autocmd BufWritePost * FormatWrite
|
||||
augroup END
|
||||
]]
|
||||
|
||||
|
|
Loading…
Reference in a new issue