fix(cmp): update keymaps
This commit is contained in:
+19
-4
@@ -47,6 +47,7 @@ return {
|
|||||||
local utils = require("utils")
|
local utils = require("utils")
|
||||||
local lspkind = utils.try_require("lspkind")
|
local lspkind = utils.try_require("lspkind")
|
||||||
|
|
||||||
|
---@type cmp.ConfigSchema
|
||||||
local opts = {
|
local opts = {
|
||||||
preselect = cmp.PreselectMode.None,
|
preselect = cmp.PreselectMode.None,
|
||||||
completion = {
|
completion = {
|
||||||
@@ -77,11 +78,25 @@ return {
|
|||||||
},
|
},
|
||||||
|
|
||||||
mapping = {
|
mapping = {
|
||||||
["<S-tab>"] = cmp.mapping.select_prev_item({
|
["<Tab>"] = cmp.mapping.select_next_item({
|
||||||
behavior = cmp.SelectBehavior.Insert,
|
behavior = cmp.SelectBehavior.Select,
|
||||||
}),
|
}),
|
||||||
["<tab>"] = cmp.mapping.select_next_item({
|
["<S-tab>"] = cmp.mapping.select_prev_item({
|
||||||
behavior = cmp.SelectBehavior.Insert,
|
behavior = cmp.SelectBehavior.Select,
|
||||||
|
}),
|
||||||
|
["<C-n>"] = cmp.mapping.select_next_item({
|
||||||
|
behavior = cmp.SelectBehavior.Select,
|
||||||
|
}),
|
||||||
|
["<C-p>"] = cmp.mapping.select_prev_item({
|
||||||
|
behavior = cmp.SelectBehavior.Select,
|
||||||
|
}),
|
||||||
|
["<CR>"] = cmp.mapping.confirm({
|
||||||
|
select = true,
|
||||||
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
|
}),
|
||||||
|
["<C-y>"] = cmp.mapping.confirm({
|
||||||
|
select = true,
|
||||||
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
}),
|
}),
|
||||||
["<C-x><C-o>"] = cmp.mapping.complete(),
|
["<C-x><C-o>"] = cmp.mapping.complete(),
|
||||||
["<C-l>"] = function(fallback)
|
["<C-l>"] = function(fallback)
|
||||||
|
|||||||
Reference in New Issue
Block a user