Adjust <Tab> for github copilot trigger

This commit is contained in:
Garrett Dawson 2023-06-27 10:45:51 -06:00
parent 1e6a8e9049
commit 4dfb1c76a2
2 changed files with 26 additions and 21 deletions

View file

@ -438,8 +438,8 @@ end
local servers = {
clangd = {},
cssls = {},
-- eslint_d = {},
gopls = {},
html = {},
pyright = {},
rust_analyzer = {},
tsserver = {},
@ -498,24 +498,24 @@ cmp.setup {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
},
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { 'i', 's' }),
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { 'i', 's' }),
-- ['<Tab>'] = cmp.mapping(function(fallback)
-- if cmp.visible() then
-- cmp.select_next_item()
-- elseif luasnip.expand_or_locally_jumpable() then
-- luasnip.expand_or_jump()
-- else
-- fallback()
-- end
-- end, { 'i', 's' }),
-- ['<S-Tab>'] = cmp.mapping(function(fallback)
-- if cmp.visible() then
-- cmp.select_prev_item()
-- elseif luasnip.locally_jumpable(-1) then
-- luasnip.jump(-1)
-- else
-- fallback()
-- end
-- end, { 'i', 's' }),
},
sources = {
{ name = 'nvim_lsp' },