1
Fork 0

LSP stuff

This commit is contained in:
Hadeed 2024-08-21 11:25:00 +05:00
parent c81d4c0bd8
commit 24103db8b6
2 changed files with 14 additions and 6 deletions

View file

@ -1,14 +1,15 @@
return {
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"L3MON4D3/LuaSnip"
},
config = function()
local cmp = require("cmp")
vim.opt.completeopt = {"menu", "menuone", "noinsert"}
cmp.setup {
snippet = {
@ -17,6 +18,7 @@ return {
end
},
mapping = cmp.mapping.preset.insert {
['<C-Space>'] = cmp.mapping.complete(),
["<C-Y>"] = function(fallback)
if cmp.visible() then
cmp.confirm { select=true }

View file

@ -6,13 +6,19 @@ return {
config = function()
local lspconfig = require("lspconfig")
lspconfig.clangd.setup {}
local snippet_capabilities = vim.lsp.protocol.make_client_capabilities()
snippet_capabilities.textDocument.completion.completionItem.snippetSupport = true
local emmet_capabilities = vim.lsp.protocol.make_client_capabilities()
emmet_capabilities.textDocument.completion.completionItem.snippetSupport = true
lspconfig.emmet_ls.setup {
capabilities = emmet_capabilities,
filetypes = { "html", "javascriptreact", "typescriptreact" }
capabilities = snippet_capabilities
}
lspconfig.tailwindcss.setup {
capabilities = snippet_capabilities
}
lspconfig.cssls.setup {
capabilities = snippet_capabilities
}
vim.api.nvim_create_autocmd("LspAttach", {