Skip to content

Commit

Permalink
neovim: Install lazy.nvim
Browse files Browse the repository at this point in the history
 Install `lazy.nvim` at startup when it hasn't installed yet.
 https://lazy.folke.io/installation

 Why is `lazy-lock.json` included into this commit?
 -> See at LazyVim/LazyVim#850

 refs #206
  • Loading branch information
m-b-t-n committed Jan 6, 2025
1 parent d729645 commit d8659dd
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
35 changes: 35 additions & 0 deletions neovim/init.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)

-- Make sure to setup `mapleader` and `maplocalleader` before
-- loading lazy.nvim so that mappings are correct.
-- This is also a good place to setup other settings (vim.opt)
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"

-- Setup lazy.nvim
require("lazy").setup({
spec = {
-- add your plugins here
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
-- install = { colorscheme = { "habamax" } },
-- automatically check for plugin updates
checker = { enabled = true },
})

-- Global Settings
vim.colorscheme = 'desert'
vim.opt.title = true
Expand Down
3 changes: 3 additions & 0 deletions neovim/lazy-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"lazy.nvim": { "branch": "main", "commit": "72aa3a2624be5dc240646084f7b6a38eb99eb2ce" }
}

0 comments on commit d8659dd

Please sign in to comment.