Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .config/nvim/lua/josean/plugins/nvim-cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,22 @@ return {
["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions
["<C-e>"] = cmp.mapping.abort(), -- close completion window
["<CR>"] = cmp.mapping.confirm({ select = false }),
["<Tab>"] = cmp.mapping(function(fallback) -- next part of snippet
if luasnip.expandable() then
luasnip.expand()
elseif luasnip.locally_jumpable(1) then
luasnip.jump(1)
else
fallback()
end
end, { "i", "s" }), -- in both insert and select mode
["<S-Tab>"] = cmp.mapping(function(fallback) -- previous part of snippet
if luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }), -- in both insert and select mode
}),
-- sources for autocompletion
sources = cmp.config.sources({
Expand Down