Closed SingularisArt closed 1 year ago
Thank you for reporting the error.
I suspect the issue was from your environment configuration
From the functions you mentioned, they are in https://github.com/SirVer/ultisnips/blob/master/autoload/UltiSnips.vim#L8
And seems py3
is not installed on your machine.
You can check by opening your vim and entering the following commands:
:py3 import vim
:py3 import UltiSnips
:py3 from UltiSnips import UltiSnips_Manager
If these commands do not work, then try install py3 module for neovim, maybe this link will help https://github.com/neovim/neovim/issues/8085
You can also check what is the output from :checkhealth
Running :py3 import vim
works, but when I run :py3 import UltiSnips
, it doesn't work, saying ModuleNotFound
. How can I install UltiSnips
?
Did you install the plugin 'SirVer/ultisnips'?
Yeah. I have it installed, via lazy.lua
.
UltiSnips module will bootstrap when the plugin manager loads 'SirVer/ultisnips' properly. The module is here if you're curious https://github.com/SirVer/ultisnips/tree/master/pythonx
Then it seems the problem is your plugin manager. Can you check the UltiSnips plugin is properly loaded by check the command: :UltiSnipsAddFiletypes
?
A similar problem reported here https://github.com/SirVer/ultisnips/issues/244
When I run that, I get the following error: E471: Argument required
. I use lazy.vim
to load. Here's the snippet that I use to load UltiSnips, and this plugin:
require("lazy").setup({
{
"hrsh7th/nvim-cmp",
config = function()
local cmp = require("cmp")
...
end,
dependencies = {
"quangnguyen30192/cmp-nvim-ultisnips",
...
},
event = "InsertEnter",
},
{
"SirVer/ultisnips",
config = function()
vim.g.UltiSnipsRemoveSelectModeMappings = 0
vim.g.UltiSnipsEditSplit = "tabdo"
vim.g.UltiSnipsSnippetDirectories = {
"~/.config/nvim/UltiSnips", "UltiSnips"
}
end,
event = "InsertEnter",
},
})
I expect "SirVer/ultisnips" is loaded before "hrsh7th/nvim-cmp" and "quangnguyen30192/cmp-nvim-ultisnips". And it had better be without the event - it should load eagerly.
Could you update and try again?
Now, I tried the following code:
require("lazy").setup({
{
"hrsh7th/nvim-cmp",
config = function()
local cmp = require("cmp")
...
end,
lazy = false,
-- event = "InsertEnter",
},
-- snippets
{
"SirVer/ultisnips",
config = function()
vim.g.UltiSnipsRemoveSelectModeMappings = 0
vim.g.UltiSnipsEditSplit = "tabdo"
vim.g.UltiSnipsSnippetDirectories = {
"~/.config/nvim/UltiSnips", "UltiSnips"
}
end,
dependencies = {
"quangnguyen30192/cmp-nvim-ultisnips",
},
lazy = false,
-- event = "InsertEnter",
},
})
But I'm still getting the error.
Can you try loading UltiSnips manually (vim.cmd("runtime! plugin/UltiSnips.vim")
) and see if that helps?
I still get the error.
It was working, until about a week ago, when I updated all my plugins, I kept getting that error. I don't know if it's a problem with how I'm using my plugin manager, or if I'm doing something wrong on my end. Would you like me to send you my neovim config link? It's relatively small.
Sure, feel free to share that. It might be caused by lazy.nvim and the way it handles caching / lazy-loading.
Sure. Here's the link.
@SingularisArt can you try with loading "SirVer/ultisnips" first, and cmp-nvim-ultisnips should be a dependencies of nvim-cmp?
require("lazy").setup({
-- snippets
{
"SirVer/ultisnips",
config = function()
vim.g.UltiSnipsRemoveSelectModeMappings = 0
vim.g.UltiSnipsEditSplit = "tabdo"
vim.g.UltiSnipsSnippetDirectories = {
"~/.config/nvim/UltiSnips", "UltiSnips"
}
end,
lazy = false,
-- event = "InsertEnter",
},
{
"hrsh7th/nvim-cmp",
config = function()
local cmp = require("cmp")
...
end,
dependencies = {
"quangnguyen30192/cmp-nvim-ultisnips",
},
lazy = false,
-- event = "InsertEnter",
},
})
It works. For some reason, after I put UltiSnips above CMP, and then run Lazy sync
, it works now.
Great to hear 😸
NVM, LOL. After exiting neovim and coming back, I still get the same issue. I'll just open a question lazy.nvim
, because I feel like it's the way lazy.nvim
is loading the plugin.
Did you put quangnguyen30192/cmp-nvim-ultisnips as the dependencies of nvim-cmp?
yeah.
Alright. Here's the link to the issue I created.
Alright. I found my issue. I had some funny autocmd issue that was conflicting with lazy.nvim
. So, I just removed it. Now, it works fine.
Here's my current config:
Here's the error:
https://user-images.githubusercontent.com/57925294/211375592-93431f93-49c3-4c15-865b-4247b44c86fb.mp4
As you can see in the video, when I type Ctrl+{j,k} and Enter, I get those errors.