From 22e0dd0f9907738e6391f5ff26ba7c07cbe1bb9d Mon Sep 17 00:00:00 2001 From: Luca Matei Pintilie Date: Wed, 1 Feb 2023 21:12:01 +0100 Subject: Fix annoying text suggestions in neovim and a tad better tmux config --- .config/nvim/lua/lsp.lua | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to '.config/nvim/lua') diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua index de52d28..f404e3d 100644 --- a/.config/nvim/lua/lsp.lua +++ b/.config/nvim/lua/lsp.lua @@ -20,9 +20,27 @@ cmp.setup({ [""] = 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" }; - { name = "vsnip" }; -- For vsnip users. - }, { { name = "buffer" } }); + { + name = "nvim_lsp"; + entry_filter = function(entry, ctx) + return require('cmp.types').lsp.CompletionItemKind[entry:get_kind()] ~= 'Text' + end; + }; + { + name = "vsnip"; + entry_filter = function(entry, ctx) + return require('cmp.types').lsp.CompletionItemKind[entry:get_kind()] ~= 'Text' + end; + }; + }, + { + { + name = "buffer"; + entry_filter = function(entry, ctx) + return require('cmp.types').lsp.CompletionItemKind[entry:get_kind()] ~= 'Text' + end; + } + }); }) -- Set configuration for specific filetype. -- cgit v1.2.3