mirror of
https://github.com/gabehf/nvim-conf.git
synced 2026-03-12 00:40:33 -07:00
fix lsp + conform + sleuth
This commit is contained in:
parent
91ba5541a3
commit
cc4abb76ee
18 changed files with 245 additions and 206 deletions
|
|
@ -1,11 +1,37 @@
|
|||
return {
|
||||
"stevearc/conform.nvim",
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("conform").setup(opts)
|
||||
return {
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufWritePre" },
|
||||
cmd = { "ConformInfo" },
|
||||
opts = {
|
||||
format_on_save = function(bufnr)
|
||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||
return
|
||||
end
|
||||
return { timeout_ms = 3000, lsp_fallback = true }
|
||||
end,
|
||||
}
|
||||
formatters_by_ft = {
|
||||
bash = { "shfmt" },
|
||||
sh = { "shfmt" },
|
||||
fish = { "fish_indent" },
|
||||
lua = { "stylua" },
|
||||
go = { "goimports", "gofumpt", "goimports-reviser" },
|
||||
javascript = { { "prettierd", "prettier" } },
|
||||
typescript = { { "prettierd", "prettier" } },
|
||||
javascriptreact = { { "prettierd", "prettier" } },
|
||||
typescriptreact = { { "prettierd", "prettier" } },
|
||||
vue = { { "prettierd", "prettier" } },
|
||||
css = { { "prettierd", "prettier" } },
|
||||
scss = { { "prettierd", "prettier" } },
|
||||
less = { { "prettierd", "prettier" } },
|
||||
html = { { "prettierd", "prettier" } },
|
||||
json = { { "prettierd", "prettier" } },
|
||||
jsonc = { { "prettierd", "prettier" } },
|
||||
yaml = { { "prettierd", "prettier" } },
|
||||
markdown = { { "prettierd", "prettier" } },
|
||||
["markdown.mdx"] = { { "prettierd", "prettier" } },
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("conform").setup(opts)
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue