mirror of
https://codeberg.org/diginaut/dotfiles.git
synced 2026-02-04 11:10:26 +01:00
Other bash/shell linter
This commit is contained in:
30
.config/nvim/lua/plugins/conform.lua
Normal file
30
.config/nvim/lua/plugins/conform.lua
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
return {
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
opts = {
|
||||||
|
|
||||||
|
formatters_by_ft = {
|
||||||
|
sh = { "shfmt" },
|
||||||
|
bash = { "shfmt" },
|
||||||
|
},
|
||||||
|
|
||||||
|
-- format_on_save = {
|
||||||
|
-- -- These options will be passed to conform.format()
|
||||||
|
-- timeout_ms = 500,
|
||||||
|
-- lsp_fallback = true,
|
||||||
|
-- quiet = true,
|
||||||
|
-- },
|
||||||
|
},
|
||||||
|
|
||||||
|
config = function(_, opts)
|
||||||
|
local conform = require("conform")
|
||||||
|
conform.setup(opts)
|
||||||
|
|
||||||
|
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
||||||
|
vim.keymap.set("n", "<leader>f", function()
|
||||||
|
conform.format({
|
||||||
|
timeout_ms = 5000,
|
||||||
|
lsp_fallback = true,
|
||||||
|
})
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user