diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-09-18 00:58:26 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-09-18 00:58:28 +0200 |
commit | cb36ccfa8db66db953795fd8e22138ed1712b1cd (patch) | |
tree | fc0f8ef4e73c5fa7fb627d383a991aeb49a59bca /lua/config/lsp.lua | |
parent | 424ad679f861031485e2e2f0ca19f5b559db929b (diff) |
checkpoint
- added basic luasnip configuration
- added highlights for TODO and FIXME keywords
- added incremental selection of treesitter
- added prettier to conform formatters
- added when_disabled function to disable pairs in comments
- changed the hiding keybind to :Hide command
- only enable ` pairs in markdown
- removed <c-k> keybind
- removed cmp's calc source
- renamed keybinds for consistency
- reorganized plugins in lazy.lua
Diffstat (limited to 'lua/config/lsp.lua')
-rw-r--r-- | lua/config/lsp.lua | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua index 715d0f9..e94966a 100644 --- a/lua/config/lsp.lua +++ b/lua/config/lsp.lua @@ -14,8 +14,9 @@ map("n", " lq", vim.diagnostic.setqflist) -- [[ LSP Setups ]] local lspconfig = require("lspconfig") --- go lspconfig.gopls.setup({}) +lspconfig.clangd.setup({}) +lspconfig.emmet_ls.setup({}) -- lua -- with neovim support @@ -54,14 +55,19 @@ require("lspconfig").lua_ls.setup({ -- [[ nvim cmp ]] require("cmp_nvim_lsp").default_capabilities() local cmp = require("cmp") +local context = require("cmp.config.context") local lspkind = require("lspkind") cmp.setup({ - completion = { - autocomplete = false, - }, + enabled = function() + if context.in_treesitter_capture("comment") == true or context.in_syntax_group("Comment") then + return false + else + return true + end + end, snippet = { expand = function(args) - require("snippy").expand_snippet(args.body) + require("luasnip").lsp_expand(args.body) end, }, window = { @@ -86,11 +92,14 @@ cmp.setup({ }), }), sources = cmp.config.sources({ - { name = "nvim_lsp" }, - -- { name = "snippy" }, + { + name = "nvim_lsp", + keyword_length = 3, + }, + { name = "luasnip" }, }, { - { name = "buffer" }, - { name = "calc" }, + -- { name = "buffer", max_item_count = 5 }, + { name = "path", max_item_count = 5 }, }), formatting = { format = lspkind.cmp_format({ |