Skip to content

Commit

Permalink
fix nvim cmp
Browse files Browse the repository at this point in the history
  • Loading branch information
dparo committed Dec 6, 2024
1 parent b958f9c commit 3858dc1
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion roles/neovim/files/lua/plugins/cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,24 @@ return {
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm { select = false }, -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.

["<C-a>"] = cmp.mapping(function(fallback)
cmp.close()
fallback()
end, { "i" }),
["<C-e>"] = cmp.mapping(function(fallback)
cmp.close()
fallback()
end, { "i" }),
['<Down>'] = cmp.mapping(function(fallback)
cmp.close()
fallback()
end, { "i" }),
['<Up>'] = cmp.mapping(function(fallback)
cmp.close()
fallback()
end, { "i" }),
},
-- IMPORTANT: The order of the sources is important. It establishes priority between source candidates
sources = cmp.config.sources({
Expand Down

0 comments on commit 3858dc1

Please sign in to comment.