Added configs

This commit is contained in:
2024-09-27 19:49:32 +02:00
parent b35f4d721d
commit ac8c786195
4 changed files with 27 additions and 4 deletions

View File

@@ -3,13 +3,29 @@ return {
"stevearc/conform.nvim",
event = { "BufReadPre", "BufNewFile" },
config = function()
function checkPrettierConfig()
local prettier_config = vim.fn.glob(".prettierrc*", 0, 1)
if prettier_config[1] == nil then
return false
end
end
function dprintOrPrettier()
if checkPrettierConfig() then
return { "prettier" }
else
return { "dprint" }
end
end
require("conform").setup({
formatters_by_ft = {
lua = { "stylua" },
javascript = { "dprint" },
typescript = { "dprint" },
json = { "dprint" },
markdown = { "dprint" },
javascript = dprintOrPrettier(),
typescript = dprintOrPrettier(),
json = dprintOrPrettier(),
markdown = dprintOrPrettier(),
svelte = { "prettier" },
},
format_on_save = {
timeout_ms = 500,

View File

@@ -33,6 +33,8 @@ return {
"yamlls",
"eslint",
"bashls",
"svelte",
"tailwindcss",
}
for _, lsp in ipairs(defaultLsps) do

View File

@@ -35,6 +35,8 @@ return {
"rust_analyzer",
"yamlls",
"bashls",
"svelte",
"tailwindcss",
},
automatic_installation = true,
})

View File

@@ -80,6 +80,9 @@ return {
"windwp/nvim-ts-autotag",
dependencies = "nvim-treesitter",
event = { "BufReadPre", "BufNewFile" },
config = function()
require("nvim-ts-autotag").setup()
end,
},
{
"szw/vim-maximizer",