From 185add40d171b41d3e09bf8f4f5a7f60af836dbc Mon Sep 17 00:00:00 2001 From: Jidbo Date: Wed, 5 Oct 2022 16:53:13 +0200 Subject: [PATCH] remove Text completions from lsp source --- nvim/lua/autocompletion.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nvim/lua/autocompletion.lua b/nvim/lua/autocompletion.lua index 343e74d..3a84ff5 100644 --- a/nvim/lua/autocompletion.lua +++ b/nvim/lua/autocompletion.lua @@ -23,9 +23,12 @@ cmp.setup({ [''] = cmp.mapping.confirm({ select = true }), }, sources = cmp.config.sources({ - { name = 'nvim_lsp' }, + { name = 'nvim_lsp', + entry_filter = function(entry, ctx) + return require('cmp.types').lsp.CompletionItemKind[entry:get_kind()] ~= 'Text' + end + }, { name = 'luasnip' }, - }, { { name = 'buffer' }, }) }) @@ -80,7 +83,7 @@ local on_attach = function(client, bufnr) buf_set_keymap("n", "gd", "Telescope lsp_definitions", opts) buf_set_keymap("n", "gD", "Telescope lsp_implementations", opts) -- buf_set_keymap("n", "gr", "Telescope lsp_references", opts) - vim.keymap.set("n", "gf",vim.lsp.buf.formatting) + vim.keymap.set("n", "gf",vim.lsp.buf.format) vim.keymap.set("n", "gh", vim.lsp.buf.hover) vim.keymap.set("n", "ge", vim.diagnostic.open_float) vim.keymap.set("n", "gs", vim.lsp.buf.signature_help)