forked from dineshsalunke/nvim-config
refactor: replace formatter plugin with conform
This commit is contained in:
parent
e1930ef9d3
commit
385bf1bd50
@ -10,9 +10,9 @@
|
|||||||
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
|
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
|
||||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||||
|
"conform.nvim": { "branch": "master", "commit": "069e971295a34a810484b7b2ef54b3c735214181" },
|
||||||
"dressing.nvim": { "branch": "master", "commit": "e3714c8049b2243e792492c4149e4cc395c68eb9" },
|
"dressing.nvim": { "branch": "master", "commit": "e3714c8049b2243e792492c4149e4cc395c68eb9" },
|
||||||
"flash.nvim": { "branch": "main", "commit": "43f67935d388fbb540f8b40e8cbfd80de54f978a" },
|
"flash.nvim": { "branch": "main", "commit": "43f67935d388fbb540f8b40e8cbfd80de54f978a" },
|
||||||
"formatter.nvim": { "branch": "master", "commit": "ad246d34ce7a32f752071ed81b09b94e6b127fad" },
|
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "4a143f13e122ab91abdc88f89eefbe70a4858a56" },
|
"gitsigns.nvim": { "branch": "main", "commit": "4a143f13e122ab91abdc88f89eefbe70a4858a56" },
|
||||||
"glow.nvim": { "branch": "main", "commit": "238070a686c1da3bccccf1079700eb4b5e19aea4" },
|
"glow.nvim": { "branch": "main", "commit": "238070a686c1da3bccccf1079700eb4b5e19aea4" },
|
||||||
"indent-blankline.nvim": { "branch": "master", "commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" },
|
"indent-blankline.nvim": { "branch": "master", "commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" },
|
||||||
|
@ -35,9 +35,3 @@ vim.api.nvim_create_autocmd("BufEnter", {
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.api.nvim_create_augroup("__formatter__", { clear = true })
|
|
||||||
vim.api.nvim_create_autocmd("BufWritePost", {
|
|
||||||
group = "__formatter__",
|
|
||||||
command = ":FormatWrite"
|
|
||||||
})
|
|
||||||
|
@ -133,41 +133,24 @@ return {
|
|||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"mhartington/formatter.nvim",
|
"stevearc/conform.nvim",
|
||||||
opts = {},
|
opts = {},
|
||||||
config = function()
|
config = function()
|
||||||
local formatter = require("formatter")
|
local confrom = require("conform")
|
||||||
formatter.setup({
|
confrom.setup({
|
||||||
filetype = {
|
log_level = vim.log.levels.DEBUG,
|
||||||
lua = {
|
formatters_by_ft = {
|
||||||
require("formatter.filetypes.lua").stylua,
|
lua = { "stylua" },
|
||||||
},
|
javascript = { "prettierd", "eslint_d" },
|
||||||
typescript = {
|
typescript = { "prettierd", "eslint_d" },
|
||||||
require("formatter.filetypes.typescript").prettierd,
|
typescriptreact = { "prettierd", "eslint_d" },
|
||||||
require("formatter.filetypes.typescript").eslint_d,
|
json = { "prettierd" },
|
||||||
},
|
jsonc = { "prettierd" },
|
||||||
typescriptreact = {
|
go = { "gofumpt", "goimports" },
|
||||||
require("formatter.filetypes.typescript").prettierd,
|
},
|
||||||
require("formatter.filetypes.typescript").eslint_d,
|
format_on_save = {
|
||||||
},
|
timeout_ms = 500,
|
||||||
javascript = {
|
lsp_fallback = true,
|
||||||
require("formatter.filetypes.typescript").prettierd,
|
|
||||||
require("formatter.filetypes.typescript").eslint_d,
|
|
||||||
},
|
|
||||||
javascriptreact = {
|
|
||||||
require("formatter.filetypes.typescript").prettierd,
|
|
||||||
require("formatter.filetypes.typescript").eslint_d,
|
|
||||||
},
|
|
||||||
json = {
|
|
||||||
require("formatter.filetypes.typescript").prettierd,
|
|
||||||
},
|
|
||||||
jsonc = {
|
|
||||||
require("formatter.filetypes.typescript").prettierd,
|
|
||||||
},
|
|
||||||
go = {
|
|
||||||
require("formatter.filetypes.go").gofumpt,
|
|
||||||
require("formatter.filetypes.go").goimports,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user