-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Add a way to configure cmp_select_opts #101
Comments
There is a way. Change the preset to local lsp = require('lsp-zero')
lsp.preset('lsp-compe')
lsp.setup()
vim.opt.completeopt = {'menu', 'menuone', 'noselect'}
local cmp = require('cmp')
local cmp_config = lsp.defaults.cmp_config({
---
-- nvim-cmp options go here
---
})
cmp.setup(cmp_config) |
Wait. You mean the select behavior when you move between items? |
Afaik, that would still require one to re-add mappings and change/insert It would be great if lspzero had a global option that could be set at the top level. |
It would be lovely if nvim-cmp had that feature. Okay. I've added local lsp = require('lsp-zero')
lsp.preset('recommended')
lsp.setup_nvim_cmp({
select_behavior = 'insert'
})
lsp.setup() Is worth mention the default in lsp-zero is the first item gets "preselected", but it seems the text won't be inserted in this case. It'll only start putting text in the buffer when you start navigating between items. If you disable the preselect you'll get something more consistent. local lsp = require('lsp-zero')
lsp.preset('recommended')
lsp.setup_nvim_cmp({
select_behavior = 'insert',
preselect = 'none',
completion = {
completeopt = 'menu,menuone,noinsert,noselect'
},
})
lsp.setup() |
Wow, thanks for the fast patch! 😄 |
Global variables FTW! |
It would be very helpful to have this as a top level configuration and not need to add mappings to override the select opts. Thanks!
The text was updated successfully, but these errors were encountered: