31 lines
754 B
Lua
31 lines
754 B
Lua
return { -- Autoformat
|
|
'stevearc/conform.nvim',
|
|
lazy = false,
|
|
keys = {
|
|
{
|
|
'<leader>f',
|
|
function()
|
|
require('conform').format { async = true, lsp_fallback = true }
|
|
end,
|
|
mode = '',
|
|
desc = '[F]ormat buffer',
|
|
},
|
|
},
|
|
opts = {
|
|
notify_on_error = false,
|
|
format_on_save = false,
|
|
formatters_by_ft = {
|
|
lua = { 'stylua' },
|
|
python = { 'isort', 'black' },
|
|
bash = { 'shfmt' },
|
|
zsh = { 'shfmt' },
|
|
sh = { 'shfmt' },
|
|
rust = { 'rustfmt', lsp_format = 'fallback' },
|
|
javascript = { { 'prettierd', 'prettier' } },
|
|
html = { { 'prettierd', 'prettier' } },
|
|
java = { 'clang-format' },
|
|
c = { 'clang-format' },
|
|
cpp = { 'clang-format' },
|
|
},
|
|
},
|
|
}
|