split up init.lua

This commit is contained in:
Thomas Ruoff
2024-03-26 22:03:40 +01:00
parent 62cea2a4ec
commit a50a611e02
23 changed files with 680 additions and 1376 deletions

View File

@@ -1,10 +1,20 @@
return {
'stevearc/conform.nvim',
opts = {
format_on_save = {
-- These options will be passed to conform.format()
timeout_ms = 500,
lsp_fallback = true,
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' } },
},
},
}