neovim - all packages
This commit is contained in:
55
home/programs/neovim/lua/plugins/conform-nvim.lua
Normal file
55
home/programs/neovim/lua/plugins/conform-nvim.lua
Normal file
@@ -0,0 +1,55 @@
|
||||
return {
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufWritePre" },
|
||||
cmd = "ConformInfo",
|
||||
keys = {
|
||||
{
|
||||
"<leader>cF",
|
||||
function()
|
||||
require("conform").format({ formatters = { "injected" } })
|
||||
end,
|
||||
mode = { "n", "v" },
|
||||
desc = "Format Injected Langs",
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("conform").setup({
|
||||
format_on_save = {
|
||||
-- These options will be passed to conform.format()
|
||||
timeout_ms = 500,
|
||||
lsp_fallback = true,
|
||||
},
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
python = { "isort", "autopep8" },
|
||||
haskell = { "fourmolu" },
|
||||
bash = { "shellcheck", "shellharden" },
|
||||
sh = { "shfmt" },
|
||||
markdown = { "prettierd" },
|
||||
json = { "prettierd" },
|
||||
yaml = { "prettierd" },
|
||||
nix = { "nixfmt" },
|
||||
tex = { "latexindent" },
|
||||
["*"] = { "codespell" },
|
||||
["_"] = { "trim_whitespace" },
|
||||
},
|
||||
formatters = {
|
||||
stylua = {
|
||||
inherit = true,
|
||||
prepend_args = { "--indent-type", "Spaces", "--indent-width", "2" },
|
||||
},
|
||||
codespell = {
|
||||
inherit = true,
|
||||
prepend_args = { "-L", "launch" },
|
||||
},
|
||||
latexindent = {
|
||||
inherit = true,
|
||||
prepend_args = { "-y=\"defaultIndent:' '\"" },
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user