feat(lsp): configure eslint, tailwindcss, tsgo and prettier

This commit is contained in:
2026-02-28 09:47:24 +01:00
parent ccb89aaffa
commit a2521f0e6f
7 changed files with 75 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
local lsp = require("lsp")
---@type vim.lsp.Config
return {
on_attach = function(client, bufnr)
lsp.on_attach(client, bufnr)
vim.keymap.set("n", "<leader>lf", function()
vim.lsp.buf.format()
require("util").format({
buf = bufnr,
cmd = {
"prettier",
"--stdin-filepath",
"%file%",
},
})
end, { buffer = bufnr })
end,
}
+4
View File
@@ -0,0 +1,4 @@
---@type vim.lsp.Config
return {
}
+3
View File
@@ -0,0 +1,3 @@
---@type vim.lsp.Config
return {
}
+24
View File
@@ -174,3 +174,27 @@ vim.api.nvim_create_autocmd("FileType", {
vim.bo.shiftwidth = 2
end,
})
vim.api.nvim_create_autocmd("FileType", {
pattern = {
"json",
"jsonc",
"markdown",
"html",
"css",
"scss",
"less",
},
callback = function(ev)
vim.keymap.set("n", "<leader>lf", function()
require("util").format({
buf = ev.buf,
cmd = {
"prettier",
"--stdin-filepath",
"%file%",
},
})
end, { buffer = ev.buf })
end,
})
+3
View File
@@ -73,6 +73,7 @@ function M.setup()
"bashls",
"clangd",
"cmake",
"eslint",
"gopls",
-- "hyprls",
"intelephense",
@@ -87,6 +88,8 @@ function M.setup()
"ruff",
"rust_analyzer",
"svelte",
"tailwindcss",
"tsgo",
"zls",
})
+19
View File
@@ -16,6 +16,7 @@ return {
"cmake-language-server",
dependencies = { "golines" },
},
"eslint-lsp",
"gopls",
"hyprls",
{
@@ -35,8 +36,26 @@ return {
"ruff",
"pyright",
"pyrefly",
{
"prettier",
filetypes = {
"json",
"jsonc",
"markdown",
"html",
"css",
"scss",
"less",
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
},
},
"rust-analyzer",
"svelte-language-server",
"tailwindcss-language-server",
"tsgo",
"zls",
},
},
+3
View File
@@ -23,6 +23,9 @@ local languages = {
"markdown",
"go",
"svelte",
"scss",
"tsx",
"typescript",
}
---@type LazyPluginSpec