From 41365e2b1d6ec38d7514e94d6ff191ae37dd4250 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Thu, 9 May 2024 16:45:45 -0400 Subject: cmp bindings --- lua/cshift/plugins/cmp.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lua/cshift/plugins') diff --git a/lua/cshift/plugins/cmp.lua b/lua/cshift/plugins/cmp.lua index a1e80b4..ae490f5 100644 --- a/lua/cshift/plugins/cmp.lua +++ b/lua/cshift/plugins/cmp.lua @@ -3,6 +3,8 @@ return { dependencies = { "neovim/nvim-lspconfig", "hrsh7th/cmp-nvim-lsp", + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", }, config = function() @@ -10,12 +12,21 @@ return { cmp.setup({ snippit = { expand = function(args) + require('luasnip').lsp_expand(args.body) end }, window = { }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({select=true}), + }), + sources = cmp.config.sources({ {name = "nvim_lsp"} }, { -- cgit v1.2.3