-
Notifications
You must be signed in to change notification settings - Fork 5
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
cmp and smart-pairs <CR> confict #7
Comments
yeah, I'll have to look into that, let me get back to you |
Thanks! I really look forward trying it out :D |
Huh, it seems that the order you load the plugins matter, from someone on reddit. Play around with it, and see what happens. |
Could you please point me to that Reddit post? I tried moving around the |
You could also play around with moving the require setup |
I have LSP configured as use {
'neovim/nvim-lspconfig',
config = function () require 'lsp' end,
requires = {
'antoinemadec/FixCursorHold.nvim',
'hrsh7th/cmp-nvim-lsp',
'L3MON4D3/LuaSnip',
'hrsh7th/cmp-path',
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/nvim-cmp',
'onsails/lspkind-nvim',
'saadparwaiz1/cmp_luasnip',
{
'kosayoda/nvim-lightbulb',
config = function () require 'nvim-lightbulb'.setup {
autocmd = { enabled = true }
} end
},
'nvim-telescope/telescope.nvim',
{
'ray-x/lsp_signature.nvim',
config = function () require 'lsp_signature'.setup {
hint_prefix = ' '
} end
},
{
'williamboman/mason.nvim',
config = function () require 'mason'.setup() end
},
{
'williamboman/mason-lspconfig.nvim',
config = function () require 'mason-lspconfig'.setup() end
}
}
} Nothing happens if I do use {
'gaoDean/autolist.nvim',
after = 'nvim-cmp',
config = function () require 'autolist'.setup() end
} If I do this use {
'gaoDean/autolist.nvim',
after = 'hrsh7th/nvim-cmp',
config = function () require 'autolist'.setup() end
} I get the following error
|
I am unfamiliar with lsps and packer, but could the error be because nvim-cmp isn't in the root of the packer, instead in "neovim/nvim-lspconfig", so the after can't access it? Also, is autolist's use before lspconfig's use? |
Not sure where you define your setup for nvim-cmp, but you want to call
This won't work because autolist's setup is called after nvim-cmp is loaded, but not after nvim-cmp's setup is loaded (since you don't define it as such). Check out my config - I managed to get it working with nvim-cmp: https://github.com/axieax/dotconfig/blob/4d193fdb081328c98e3b704639c92eeb0decc2eb/nvim/lua/axie/plugins/init.lua#L825-L834 |
I did some tests, and the issue is on the I have this mapping set to make both cmp.setup {
['<CR>'] = cmp.mapping(function ()
if not cmp.confirm { select = false } then
require 'pairs.enter'.type()
end
end)
} If I have the mapping set like this now cmp.setup {
mapping = cmp.mapping.preset.insert {
['<CR>'] = cmp.mapping.confirm { behavior = cmp.ConfirmBehavior.Replace, select = true }
}
} |
I found this link: https://github.com/windwp/nvim-autopairs#mapping-cr It's from another popular auto-pairing plugin, on how to make it work with cmp, it may be useful. I switched to |
Oh cool, thanks. Imma close this now, but this this thread is probably gonna be referenced by more people having the same problem. |
Hey, I really like the idea for your plugin, but unfortunately after installing it, it wasn't working.
I use
ZhiyuanLck/smart-pairs
for pairs andhrsh7th/nvim-cmp
for completion, and to make them both work I had to configure like this issue suggestsDo you have any suggestion on how to make your plugin work with this workaround?
The text was updated successfully, but these errors were encountered: