Skip to content
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

start nvim wrong with "in function 'nvim exec2'" #101

Open
Tianze-ya opened this issue Dec 22, 2024 · 0 comments
Open

start nvim wrong with "in function 'nvim exec2'" #101

Tianze-ya opened this issue Dec 22, 2024 · 0 comments

Comments

@Tianze-ya
Copy link

This is wrong

lazy.nvim:Failed to source/home/kali/.local/share/nvim/lazy/cmp-nvim-ultisnips/after/plugin/cmp nvim ultisnips.lua
vim/_editor.lua:0:/home/kali/.config/nvim/init.lua..nvim_exec2()called at /home/kali/.config/nvim/init.lua:0../home/kali/.local/share/nvim/lazy/
stack traceback:
C:in function 'nvim exec2'
vim/editor.lua:in function 'cmd'
.../lazy/cmp-nvim-ultisnips/lua/cmp_nvim_ultisnips/init.lua:15:in function create source'
...y/cmp-nvim-ultisnips/after/plugin/cmp_nvim_ultisnips.lua:1:in main chunk
C:in function 'nvim_exec2'
vim/editor.lua:in function 'cmd'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:510:in function <...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:509>
C:in function 'xpcall'
.../.local/share/nvim/lazy/lazy.nvim/lua/lazy/core/util.lua:135:in function 'try'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:509:in function 'source
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:457:in function source runtime'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:150:in function 'startup'
.../kali/.local/share/nvim/lazy/lazy.nvim/lua/lazy/init.lua:112:in function setup'
/home/kali/.config/nvim/lua/config/plugins.lua:19:in main chunk
C:in function 'require'
/home/kali/.config/nvim/init.lua:4:in main chunk
stacktrace:
vim/editor.lua:0 in cmd
-/config/nvim/lua/config/plugins.Lua:19
-
/.config/nvim/init.lua:4

my config
M.config = {
"hrsh7th/nvim-cmp",
after = "SirVer/ultisnips",
dependencies = {
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-calc",
{
"onsails/lspkind.nvim",
lazy = false,
config = function()
require("lspkind").init()
end
},
{
"quangnguyen30192/cmp-nvim-ultisnips",
config = function()
require("cmp_nvim_ultisnips").setup {}
end,
}
},
}

M.configfunc = function()
local lspkind = require("lspkind")
local cmp = require("cmp")
local cmp_ultisnips_mappings = require("cmp_nvim_ultisnips.mappings")

cmp.setup({
    preselect = cmp.PreselectMode.None,
    snippet = {
        expand = function(args)
            vim.fn["UltiSnips#Anon"](args.body)
        end,
    },
    window = {
        completion = {
            col_offset = -3,
            side_padding = 0,
        },
        documentation = cmp.config.window.bordered(),
    },
    sorting = {
        comparators = {
            cmp.config.compare.offset,
            cmp.config.compare.exact,
            cmp.config.compare.score,
            cmp.config.compare.recently_used,
            cmp.config.compare.kind,
        },
    },
    formatting = {
        fields = { "kind", "abbr", "menu" },
        maxwidth = 60,
        maxheight = 10,
        format = function(entry, vim_item)
            local kind = lspkind.cmp_format({
                mode = "symbol_text",
                symbol_map = { Codeium = "", },
            })(entry, vim_item)
            local strings = vim.split(kind.kind, "%s", { trimempty = true })
            kind.kind = " " .. (strings[1] or "") .. " "
            kind.menu = limitStr(entry:get_completion_item().detail or "")

            return kind
        end,
    },
    sources = cmp.config.sources({
        { name = "nvim_lsp" },
        { name = "buffer" },
        { name = "ultisnips" },
    }, {
        { name = "path" },
        { name = "nvim_lua" },
        { name = "calc" },
    }),
    mapping = cmp.mapping.preset.insert({.........

end

I want to solve it
Please help me and tell me the reason
Tank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant