-
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
How to pass completion
option through to nvim-cmp
#7
Comments
completion
option through to nvim-cmp
This should work now. local lsp = require('lsp-zero')
lsp.preset('recommended')
lsp.setup_nvim_cmp({
completion = { autocomplete = false }
})
lsp.setup() |
Thank you for your lightening fast response! I've updated your plugin in my setup (Using plug, so I ran :PlugUpdate). I saw that lsp-zero was updated. I also went to the I have a series of lsp calls in my lua config: local lspz = require('lsp-zero')
lspz.set_preferences({
suggest_lsp_servers = true,
setup_servers_on_start = true,
set_lsp_keymaps = false, -- Toggled b/c the defaults are alright but not great for me.
configure_diagnostics = true,
cmp_capabilities = true,
manage_nvim_cmp = true,
call_servers = 'local',
sign_icons = {
error = '✘',
warn = '▲',
hint = '⚑',
info = ''
}
})
lspz.on_attach(function()
local noremap = {noremap = true}
local map = function(...) vim.api.nvim_buf_set_keymap(0, ...) end
map('n', '<leader>je', '<cmd>lua vim.lsp.buf.rename()<cr>', noremap)
map('n', '<leader>jk', '<cmd>lua vim.lsp.buf.hover()<cr>', noremap)
map('n', '<leader>jd', '<cmd>lua vim.lsp.buf.definition()<cr>', noremap)
map('n', '<leader>jD', '<cmd>lua vim.lsp.buf.declaration()<cr>', noremap)
map('n', '<leader>jt', '<cmd>lua vim.lsp.buf.type_definition()<cr>', noremap)
map('n', '<leader>ji', '<cmd>lua vim.lsp.buf.implementation()<cr>', noremap)
map('n', '<leader>jr', '<cmd>lua vim.lsp.buf.references()<cr>', noremap)
map('n', '<leader>js', '<cmd>lua vim.lsp.buf.signature_help()<cr>', noremap)
map('n', '<leader>ja', '<cmd>lua vim.lsp.buf.code_action()<cr>', noremap)
map('n', '<leader>jf', '<cmd>lua LspZeroFormat<cr>', noremap)
map('n', '<leader>jw', '<cmd>lua vim.diagnostic.open_float()<cr>', noremap)
map('n', '<C-l>', '<cmd>lua vim.diagnostic.goto_prev()<cr>', noremap)
map('n', '<C-h>', '<cmd>lua vim.diagnostic.goto_next()<cr>', noremap)
end)
lspz.setup_nvim_cmp({
completion = { autocomplete = false }
})
lspz.setup() However I'm still seeing autocompletion. Am I doing anything obviously wrong? |
It works for me. Could it be another plugin or old configuration code still around? Side note: |
Ah oh nice, thank you for the heads up about I'm not really sure, I'll keep looking into it and if I find an answer I'll come back and post. Thanks for your help! UPDATE: User error all the way. In figuring out where I was going to house my rc/init scripts and just generally getting it all working, I forgot to make a sym link to a file and was editing one in the wrong directory. Works now like a charm. |
Is there a way to pass the
{ 'completion.autocomplete' }
option through tocmp
? I'm trying to get a debounce on my completion, which led me to hrsh7th/nvim-cmp#598, which requires a config param (autocomplete
) be passed in tocmp
beforecmp.setup()
is called. Looks likecmp
documents a similar approach to a problem here.I see your documentation of setup_nvim_cmp but I'm not clearly understanding from the docs whether the
completion
list will be passed in, and in my attempts to make it work, it is not working.P.S. Thank you for making this tool! I'm fresh in the nvim world from vim and this tool has really eased my transition.
The text was updated successfully, but these errors were encountered: