change cmp complete and selection behavior

This commit is contained in:
♥ Minnie ♥ 2025-03-14 22:13:43 +08:00
parent 8d05aab071
commit 018c95dbd3
Signed by: jasmine
GPG key ID: 8563E358D4E8040E

View file

@ -20,27 +20,18 @@
'';
# cmp mappings declaration
mapping = {
"<C-s>" =
# Lua
"cmp.mapping.scroll_docs(-4)";
"<C-t>" =
# Lua
"cmp.mapping.scroll_docs(4)";
"<C-Space>" =
# Lua
"cmp.mapping.complete()";
"<C-esc>" =
"<esc>" =
# Lua
"cmp.mapping.close()";
"<Tab>" =
"<Down>" =
# Lua
"cmp.mapping(cmp.mapping.select_next_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})";
"<S-Tab>" =
"<Up>" =
# Lua
"cmp.mapping(cmp.mapping.select_prev_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})";
"<CR>" =
"<Tab>" =
# Lua
"cmp.mapping.confirm({ select = false, behavior = cmp.ConfirmBehavior.Replace })";
"cmp.mapping.confirm({ select = true, behavior = cmp.ConfirmBehavior.Replace })";
};
};
# Scans the sources array and enable the corresponding plugins if they are known to nixvim.