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", "stevearc/conform.nvim",
event = { "BufReadPre", "BufNewFile" }, event = { "BufReadPre", "BufNewFile" },
config = function() 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({ require("conform").setup({
formatters_by_ft = { formatters_by_ft = {
lua = { "stylua" }, lua = { "stylua" },
javascript = { "dprint" }, javascript = dprintOrPrettier(),
typescript = { "dprint" }, typescript = dprintOrPrettier(),
json = { "dprint" }, json = dprintOrPrettier(),
markdown = { "dprint" }, markdown = dprintOrPrettier(),
svelte = { "prettier" },
}, },
format_on_save = { format_on_save = {
timeout_ms = 500, timeout_ms = 500,

View File

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

View File

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

View File

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