feat(conform): add more formatters
This commit is contained in:
parent
0628c3e2ec
commit
23fe78acec
1 changed files with 32 additions and 31 deletions
|
|
@ -1,34 +1,35 @@
|
|||
-- Some things are from https://www.josean.com/posts/neovim-linting-and-formatting
|
||||
return {
|
||||
"stevearc/conform.nvim",
|
||||
tag = "stable",
|
||||
opts = {},
|
||||
config = function()
|
||||
local conform = require("conform")
|
||||
conform.setup({
|
||||
-- formatters_by_ft = {
|
||||
formatters = {
|
||||
javascript = { "prettier" },
|
||||
typescript = { "prettier" },
|
||||
javascriptreact = { "prettier" },
|
||||
typescriptreact = { "prettier" },
|
||||
svelte = { "prettier" },
|
||||
css = { "prettier" },
|
||||
html = { "prettier" },
|
||||
json = { "prettier" },
|
||||
yaml = { "prettier" },
|
||||
markdown = { "prettier" },
|
||||
graphql = { "prettier" },
|
||||
lua = { "stylua" },
|
||||
python = { "isort", "black" },
|
||||
sh = { "shfmt" },
|
||||
},
|
||||
stop_after_first = false,
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 1000, -- default: 1000
|
||||
},
|
||||
})
|
||||
end,
|
||||
"stevearc/conform.nvim",
|
||||
tag = "stable",
|
||||
opts = {},
|
||||
config = function()
|
||||
local conform = require("conform")
|
||||
conform.setup({
|
||||
formatters_by_ft = {
|
||||
javascript = { "prettier" },
|
||||
typescript = { "prettier" },
|
||||
javascriptreact = { "prettier" },
|
||||
typescriptreact = { "prettier" },
|
||||
svelte = { "prettier" },
|
||||
css = { "prettier" },
|
||||
html = { "prettier" },
|
||||
json = { "prettier" },
|
||||
yaml = { "prettier" },
|
||||
markdown = { "prettier" },
|
||||
graphql = { "prettier" },
|
||||
lua = { "stylua" },
|
||||
python = { "isort", "black" },
|
||||
sh = { "shfmt" },
|
||||
terraform = { "tflint" },
|
||||
hcl = { "hclfmt" },
|
||||
},
|
||||
stop_after_first = false,
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 1000, -- default: 1000
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue