mirror of
https://github.com/tomru/nvim.git
synced 2026-03-03 22:47:18 +01:00
21 lines
577 B
Lua
21 lines
577 B
Lua
return {
|
|
'stevearc/conform.nvim',
|
|
opts = {
|
|
notify_on_error = true,
|
|
format_on_save = function(bufnr)
|
|
local disable_filetypes = { c = true, cpp = true }
|
|
return {
|
|
timeout_ms = 1000,
|
|
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
|
|
}
|
|
end,
|
|
formatters_by_ft = {
|
|
lua = { 'stylua' },
|
|
javascript = { { 'eslint_d', 'prettier' } },
|
|
javascriptreact = { { 'eslint_d', 'prettier' } },
|
|
typescript = { { 'eslint_d', 'prettier' } },
|
|
typescriptreact = { { 'eslint_d', 'prettier' } },
|
|
},
|
|
},
|
|
}
|