chore(lsp-config.lua): refactor code formatting and improve readability

feat(lsp-config.lua): add support for tailwindcss lsp and attach tailwind_colors only when using tailwindcss lsp
feat(lsp-config.lua): add key mappings for various LSP functionalities like go to declaration, go to definitions, show documentation, show LSP implementation, get help, show LSP type definitions, smart rename, see available code actions, show LSP references, format file, and restart LSP
feat(lsp-config.lua): configure language servers for html, typescript, css, tailwindcss, svelte, emmet, python, jedi, docker, json, vue, rust, lua, css, htmx, docker file, docker compose, and eslint
This commit is contained in:
David Ibia
2024-01-16 01:34:57 +01:00
parent 8c04ed3ff7
commit 2f81b9e3f7

View File

@@ -7,7 +7,10 @@ local opts = { noremap = true, silent = true }
local on_attach = function(client, bufnr) local on_attach = function(client, bufnr)
opts.buffer = bufnr opts.buffer = bufnr
-- Only attach when we are using the tailwindcss lsp
if client.name == "tailwindcss" then
tailwind_colors.buf_attach(bufnr) tailwind_colors.buf_attach(bufnr)
end
-- Enable completion triggered by <c-x><c-o> -- Enable completion triggered by <c-x><c-o>
-- vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' -- vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'