Plugin isn't responsive with fallback()
Closed this issue · 2 comments
zeta-squared commented
If you use fallback()
in an if-else
clause for <Tab>
behaviour with nvim-cmp
then tabout
does not trigger. Below is my config.
local cmp = require('cmp')
cmp.setup({
sources = {
{name = 'nvim_lsp'},
{name = 'ultisnips'},
},
mapping = cmp.mapping.preset.insert({
['<Tab>'] = function(fallback)
if cmp.visible() then
cmp.confirm({select = true})
else
fallback()
end
end
}),
snippet = {
expand = function(args)
vim.fn["UltiSnips#Anon"](args.body)
end,
},
})
require('tabout').setup({
tabkey = '<Tab>',
backwards_tabkey = '<S-Tab>',
act_as_tab = false,
act_as_shift_tab = false,
default_tab = '<C-t>',
default_shift_tab = '<C-d>',
enable_backwards = true,
completion = true,
tabouts = {
{open = "'", close = "'"},
{open = '"', close = '"'},
{open = '`', close = '`'},
{open = '(', close = ')'},
{open = '[', close = ']'},
{open = '{', close = '}'}
},
ignore_beginning = true,
exlude = {}
})
require('ultimate-autopair').setup({})
abecodes commented
No idea, I do not use cmp...I guess you need to load tabout before you load cmp to make it work
uwla commented
I had similar problem and solved it by setting completion=false
and manually requiring tabout from nvim-cmp. If you want, my config is here #57 (comment)