lsp-zero cannot be loaded in Lazy #400
Replies: 3 comments 1 reply
-
And, in the guide lazy loading with lazy nvim, the config is inside the return function of lazy
|
Beta Was this translation helpful? Give feedback.
-
What's the error message you get? At that point of the tutorial your local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
local uv = vim.uv or vim.loop
-- Auto-install lazy.nvim if not present
if not uv.fs_stat(lazypath) then
print('Installing lazy.nvim....')
vim.fn.system({
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable', -- latest stable release
lazypath,
})
print('Done.')
end
vim.opt.rtp:prepend(lazypath)
require('lazy').setup({
{'folke/tokyonight.nvim'},
{'VonHeikemen/lsp-zero.nvim', branch = 'v3.x'},
{'neovim/nvim-lspconfig'},
{'hrsh7th/cmp-nvim-lsp'},
{'hrsh7th/nvim-cmp'},
{'L3MON4D3/LuaSnip'},
})
vim.opt.termguicolors = true
vim.cmd.colorscheme('tokyonight')
local lsp_zero = require('lsp-zero')
lsp_zero.on_attach(function(client, bufnr)
-- see :help lsp-zero-keybindings
-- to learn the available actions
lsp_zero.default_keymaps({buffer = bufnr})
end) |
Beta Was this translation helpful? Give feedback.
-
Oh, I see whats the issue here, I was doing the above on my seperate lsp-zero.lua file. Thanks for pointing out and helping. |
Beta Was this translation helpful? Give feedback.
-
Hello, just a quick question, new user here. So I read the guide and it says to add the snippet at the end of the file
here it is:
but when I do, it says lsp-zero failed to load.
I initially put the config in the same plugin folder too, but it too didn't load lsp-zero (but it did install lsp-zero, mason, ..... etc)
Please Help. Thanks for your time
Beta Was this translation helpful? Give feedback.
All reactions