mirror of
https://github.com/itme-brain/nixos.git
synced 2026-03-24 00:29:43 -04:00
Working pretty good, use this. Formatted a bit
This commit is contained in:
parent
a221b0e725
commit
652326e5f4
1 changed files with 21 additions and 20 deletions
|
|
@ -69,27 +69,7 @@ cmp.setup({
|
||||||
return not context.in_treesitter_capture("comment") and not context.in_syntax_group("Comment")
|
return not context.in_treesitter_capture("comment") and not context.in_syntax_group("Comment")
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
mapping = {
|
mapping = {
|
||||||
-- ["<Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
-- if vim.fn.pumvisible() == 1 then
|
|
||||||
-- vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<C-y>", true, true, true), "n")
|
|
||||||
-- elseif luasnip.expand_or_jumpable() then
|
|
||||||
-- vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "")
|
|
||||||
-- else
|
|
||||||
-- fallback()
|
|
||||||
-- end
|
|
||||||
-- end, { "i", "s" }),
|
|
||||||
|
|
||||||
-- ["<S-Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
-- if vim.fn.pumvisible() == 1 then
|
|
||||||
-- vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<C-p>", true, true, true), "n")
|
|
||||||
-- elseif luasnip.jumpable(-1) then
|
|
||||||
-- vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "")
|
|
||||||
-- else
|
|
||||||
-- fallback()
|
|
||||||
-- end
|
|
||||||
-- end, { "i", "s" }),
|
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
|
|
@ -113,6 +93,7 @@ cmp.setup({
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { "i", "s" }),
|
end, { "i", "s" }),
|
||||||
|
|
||||||
["<CR>"] = cmp.mapping({
|
["<CR>"] = cmp.mapping({
|
||||||
i = function(fallback)
|
i = function(fallback)
|
||||||
if cmp.visible() and cmp.get_active_entry() then
|
if cmp.visible() and cmp.get_active_entry() then
|
||||||
|
|
@ -124,6 +105,26 @@ cmp.setup({
|
||||||
s = cmp.mapping.confirm({ select = true }),
|
s = cmp.mapping.confirm({ select = true }),
|
||||||
c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }),
|
c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }),
|
||||||
}),
|
}),
|
||||||
|
-- Lazyvim default
|
||||||
|
-- ["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
-- if vim.fn.pumvisible() == 1 then
|
||||||
|
-- vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<C-y>", true, true, true), "n")
|
||||||
|
-- elseif luasnip.expand_or_jumpable() then
|
||||||
|
-- vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "")
|
||||||
|
-- else
|
||||||
|
-- fallback()
|
||||||
|
-- end
|
||||||
|
-- end, { "i", "s" }),
|
||||||
|
|
||||||
|
-- ["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
-- if vim.fn.pumvisible() == 1 then
|
||||||
|
-- vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<C-p>", true, true, true), "n")
|
||||||
|
-- elseif luasnip.jumpable(-1) then
|
||||||
|
-- vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "")
|
||||||
|
-- else
|
||||||
|
-- fallback()
|
||||||
|
-- end
|
||||||
|
-- end, { "i", "s" }),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue