Using cmp_action
to setup
#311
-
Currently, I'm using something like this to setup local cmp = require "cmp"
local cmp_action = require("lsp-zero").cmp_action()
cmp.setup {
mapping = cmp.mapping.preset.insert {
["<C-CR>"] = cmp.mapping.confirm { select = true },
["<C-c>"] = cmp_action.toggle_completion(),
["<A-u>"] = cmp.mapping.scroll_docs(-4),
["<A-d>"] = cmp.mapping.scroll_docs(4),
["<Tab>"] = cmp_action.tab_complete(),
["<S-Tab>"] = cmp_action.select_prev_or_fallback(),
["<C-n>"] = cmp.config.disable,
["<C-p>"] = cmp.config.disable
},
}
local cmdline_mapping = cmp.mapping.preset.cmdline {
["<C-c>"] = { c = function()
if cmp.visible() then
cmp.abort()
else
cmp.complete()
end
end },
["<C-CR>"] = { c = cmp.mapping.confirm { select = true }, },
["<C-n>"] = { c = cmp.config.disable },
["<C-p>"] = { c = cmp.config.disable }
}
cmp.setup.cmdline({ "/", "?" }, {
mapping = cmdline_mapping,
...
}) Would you consider extending |
Beta Was this translation helpful? Give feedback.
Answered by
VonHeikemen
Sep 9, 2023
Replies: 1 comment
-
Sure. You can now pass an arguments with a list of modes. cmp_action.toggle_completion({modes = {'c'}}), |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
simonmandlik
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sure. You can now pass an arguments with a list of modes.