diff --git a/home/.config/nvim/lua/plugs/cmp.lua b/home/.config/nvim/lua/plugs/cmp.lua index 09a3b76..ce4ee98 100644 --- a/home/.config/nvim/lua/plugs/cmp.lua +++ b/home/.config/nvim/lua/plugs/cmp.lua @@ -7,15 +7,10 @@ return { "hrsh7th/cmp-cmdline", }, config = function() - -- Set up nvim-cmp. local cmp = require("cmp") + cmp.setup({ - snippet = { - expand = function(args) - vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+) - end, - }, window = { completion = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(), @@ -26,11 +21,14 @@ return { [""] = cmp.mapping.complete(), [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. }), - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - }, + sources = cmp.config.sources( { - { name = "buffer" }, + { + name = "nvim_lsp", + entry_filter = function(entry) + return cmp.lsp.CompletionItemKind.Snippet ~= entry:get_kind() + end, + }, }) }) diff --git a/home/.config/nvim/lua/plugs/mason_lsp.lua b/home/.config/nvim/lua/plugs/mason_lsp.lua index 7ff4895..640250a 100644 --- a/home/.config/nvim/lua/plugs/mason_lsp.lua +++ b/home/.config/nvim/lua/plugs/mason_lsp.lua @@ -7,6 +7,7 @@ local function setup_lsp(server_names) local server = lspconfig[server_name] if server then local server_table = require("language_servers/" .. server_name) + capabilities.textDocument.completion.completionItem.snippetSupport = false server_table.capabilities = capabilities server_table.on_attach = function(client, bufnr) vim.lsp.inlay_hint.enable(true, { bufnr = bufnr })