summaryrefslogtreecommitdiff
path: root/lua/cshift/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'lua/cshift/plugins')
-rw-r--r--lua/cshift/plugins/cmp.lua11
1 files changed, 11 insertions, 0 deletions
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({
+ ['<C-b>'] = cmp.mapping.scroll_docs(-4),
+ ['<C-f>'] = cmp.mapping.scroll_docs(4),
+ ['<C-Space>'] = cmp.mapping.complete(),
+ ['<C-e>'] = cmp.mapping.abort(),
+ ['<S-CR>'] = cmp.mapping.confirm({select=true}),
+ }),
+
sources = cmp.config.sources({
{name = "nvim_lsp"}
}, {