feat: update cmp mappings, fix: auto session save issues when notification is present
This commit is contained in:
parent
a50452bf4f
commit
362a77e60d
2 changed files with 22 additions and 5 deletions
|
@ -20,10 +20,13 @@ M.init = function()
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
mapping = {
|
mapping = {
|
||||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
['<C-d>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
|
||||||
['<C-u>'] = cmp.mapping.scroll_docs(4),
|
['<C-u>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
|
||||||
['<C-Space>'] = cmp.mapping.complete(),
|
['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
|
||||||
['<C-e>'] = cmp.mapping.close(),
|
['<C-e>'] = cmp.mapping({
|
||||||
|
i = cmp.mapping.abort(),
|
||||||
|
c = cmp.mapping.close(),
|
||||||
|
}),
|
||||||
-- disabled for autopairs mapping
|
-- disabled for autopairs mapping
|
||||||
['<CR>'] = cmp.mapping.confirm({
|
['<CR>'] = cmp.mapping.confirm({
|
||||||
behavior = cmp.ConfirmBehavior.Replace,
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
|
@ -83,6 +86,20 @@ M.init = function()
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
cmp.setup.cmdline('/', {
|
||||||
|
sources = {
|
||||||
|
{ name = 'buffer' },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
cmp.setup.cmdline(':', {
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'path' },
|
||||||
|
}, {
|
||||||
|
{ name = 'cmdline' },
|
||||||
|
}),
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
M.autopairs = function()
|
M.autopairs = function()
|
||||||
|
|
|
@ -203,7 +203,7 @@ return packer.startup(function()
|
||||||
event = 'VimEnter',
|
event = 'VimEnter',
|
||||||
config = function()
|
config = function()
|
||||||
require('auto-session').setup({
|
require('auto-session').setup({
|
||||||
pre_save_cmds = { 'NvimTreeClose', 'cclose' },
|
pre_save_cmds = { 'NvimTreeClose', 'cclose', 'lua vim.notify.dismiss()' },
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
disable = vim.tbl_contains(user_plugins.disable, 'auto-session'),
|
disable = vim.tbl_contains(user_plugins.disable, 'auto-session'),
|
||||||
|
|
Loading…
Add table
Reference in a new issue