From ae1fcff4be48e88f32a642073e65a0c8c4674b1e Mon Sep 17 00:00:00 2001 From: Gabe Venberg Date: Mon, 7 Feb 2022 13:41:50 -0600 Subject: [PATCH] Revert "added friendly snippets" caused problems with keybindings for autocomplete. This reverts commit c9aa2dca270ee1aee9931a545c39d8fdf348c097. --- neovim/.config/nvim/lua/cmp-lsp.lua | 37 ++++++++++++++-------------- neovim/.config/nvim/lua/packages.lua | 12 --------- 2 files changed, 19 insertions(+), 30 deletions(-) diff --git a/neovim/.config/nvim/lua/cmp-lsp.lua b/neovim/.config/nvim/lua/cmp-lsp.lua index a83ddee..3bd78b7 100644 --- a/neovim/.config/nvim/lua/cmp-lsp.lua +++ b/neovim/.config/nvim/lua/cmp-lsp.lua @@ -1,5 +1,6 @@ --configure nvim-cmp for use with lsp and luasnip. + -- Add additional capabilities supported by nvim-cmp local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities) @@ -39,25 +40,25 @@ cmp.setup { behavior = cmp.ConfirmBehavior.Replace, select = true, }, + [''] = function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, + [''] = function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, }, - [''] = function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - else - fallback() - end - end, - [''] = function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, sources = { { name = 'nvim_lsp' }, { name = 'luasnip' }, diff --git a/neovim/.config/nvim/lua/packages.lua b/neovim/.config/nvim/lua/packages.lua index 8d265c9..e9c2d62 100644 --- a/neovim/.config/nvim/lua/packages.lua +++ b/neovim/.config/nvim/lua/packages.lua @@ -34,18 +34,6 @@ return require('packer').startup(function(use) } } - -- 'honza/vim-snippets', - use {'L3MON4D3/LuaSnip', - requires={ - 'rafamadriz/friendly-snippets' - }, - config=function() - require("luasnip.loaders.from_snipmate").load() - require("luasnip.loaders.from_vscode").load() - end - - } - use {'nvim-telescope/telescope.nvim', requires = { {'nvim-lua/plenary.nvim'},