add yaml formatter
This commit is contained in:
parent
e92f552ae2
commit
9f4dc0aced
1 changed files with 17 additions and 16 deletions
|
|
@ -31,22 +31,23 @@ return {
|
||||||
"stevearc/conform.nvim",
|
"stevearc/conform.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require("conform").setup({
|
require("conform").setup({
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
lua = { "stylua" },
|
lua = { "stylua" },
|
||||||
javascript = { "prettierd" },
|
javascript = { "prettierd" },
|
||||||
typescript = { "prettierd" },
|
typescript = { "prettierd" },
|
||||||
javascriptreact = { "prettierd" },
|
javascriptreact = { "prettierd" },
|
||||||
typescriptreact = { "prettierd" },
|
typescriptreact = { "prettierd" },
|
||||||
go = { "gofumpt" },
|
go = { "gofumpt" },
|
||||||
python = { "autopep8" },
|
python = { "autopep8" },
|
||||||
},
|
yaml = { "yamlfmt" },
|
||||||
format_on_save = function(bufnr)
|
},
|
||||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
format_on_save = function(bufnr)
|
||||||
return
|
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||||
end
|
return
|
||||||
return { timeout_ms = 500, lsp_fallback = true }
|
end
|
||||||
end,
|
return { timeout_ms = 500, lsp_fallback = true }
|
||||||
})
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
vim.api.nvim_create_user_command("FormatDisable", function()
|
vim.api.nvim_create_user_command("FormatDisable", function()
|
||||||
vim.g.disable_autoformat = true
|
vim.g.disable_autoformat = true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue