feat(nvim): disable lazy for vscode

This commit is contained in:
Maciej Jur 2023-08-21 20:52:44 +02:00
parent b7b6c40c01
commit 65f182862a
Signed by: kamov
GPG key ID: 191CBFF5F72ECAFD
3 changed files with 25 additions and 17 deletions

View file

@ -1,15 +1,19 @@
if vim.loader then vim.loader.enable() end -- Is new loader available?
if vim.loader then
vim.loader.enable()
end
-- Setup global config -- Setup default options
require("global") require("options")
-- Only run this if inside Neovide -- Are we inside Neovide?
if vim.g.neovide then if vim.g.neovide then
require("neovide") require("neovide")
end end
-- Bootstrap Lazy -- Are we outside VSCode?
do if not vim.g.vscode then
-- Bootstrap Lazy
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ vim.fn.system({
@ -22,15 +26,20 @@ do
}) })
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
end
-- Load lazy
-- Load lazy local ok, err = pcall(function()
local lazy_ok, lazy = pcall(require, "lazy") local plugins, lazy = require("plugins"), require("lazy")
if lazy_ok then lazy.setup(plugins)
local plugins = require("plugins") vim.keymap.set('n', '<leader>pm', lazy.home, { desc = "Package manager: open" })
lazy.setup(plugins) end)
vim.keymap.set('n', '<leader>pm', lazy.home, { desc = "Package manager: open" })
else if not ok then
print("(init) Couldn't load Lazy") -- save my eyes
vim.cmd("colorscheme slate")
vim.schedule(function()
vim.notify(err, vim.log.levels.ERROR)
end)
end
end end

View file

@ -1,6 +1,5 @@
local U = require("utils") local U = require("utils")
return { return {
-- Editor theme -- Editor theme