Files
.dotfiles/.config/nvim/lua/plugin/conform.lua
Quinn 311c317e00 Use shfmt for bash instead of sh.
Similar reason as previous commit;
3eeff04c9b, use `shellcheck` for `bash`
instead of `sh`.
`sh` files get their filetype set to `bash`, for treesitter to function
properly.
2026-02-03 20:24:01 +01:00

24 lines
764 B
Lua

MiniDeps.add({ source = 'https://github.com/stevearc/conform.nvim' })
require('conform').setup({
notify_on_error = true,
formatters_by_ft = {
c = { 'clang-format' },
h = { 'clang-format' },
cpp = { 'clang-format' },
hpp = { 'clang-format' },
glsl = { 'clang-format', lsp_format = "first" },
typescript = { 'clang-format', lsp_format = "first" },
css = { 'clang-format' },
rust = { 'rustfmt' },
bash = { 'shfmt' },
python = { 'isort' },
-- json = { 'jq' },
-- yaml = { 'yq' },
toml = { 'yq' },
xml = { 'yq' },
},
})
Map('n', '<leader>f', function()
require('conform').format({ async = true, lsp_format = 'fallback' })
end, { desc = 'Format Buffer' })