fix up my cmp window keys, make escape make more sense when a cmp is open like copilot
This commit is contained in:
parent
d10a5f1a83
commit
20caebb224
1 changed files with 11 additions and 4 deletions
|
@ -233,11 +233,11 @@ return {
|
|||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-j>"] = cmp.mapping.select_next_item(),
|
||||
["<C-k>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete({}),
|
||||
["<C-u>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<CR>"] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
|
@ -261,6 +261,13 @@ return {
|
|||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<esc>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.abort()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end),
|
||||
}),
|
||||
sources = {
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue