From 387e08c52d9752bc839c71119f140ba8435c3d70 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Fri, 18 Aug 2023 23:42:39 +0300 Subject: nvim: switch to lazy.nvim revert this as whole, if you miss the good old days --- .config/nvim/lua/core/lazy.lua | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .config/nvim/lua/core/lazy.lua (limited to '.config/nvim/lua/core/lazy.lua') diff --git a/.config/nvim/lua/core/lazy.lua b/.config/nvim/lua/core/lazy.lua new file mode 100644 index 0000000..8a91029 --- /dev/null +++ b/.config/nvim/lua/core/lazy.lua @@ -0,0 +1,30 @@ +-- install lazy.nvim if not already installed +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +-- use a protected call so we don't error out on first use +local ok, lazy = pcall(require, "lazy") +if not ok then + return +end + +-- we have to set the leader key here for lazy.nvim to work +require("helpers.keys").set_leader("\\") + +-- load plugins from specifications +-- see: https://github.com/folke/lazy.nvim#-structuring-your-plugins +-- we are loading them as a lua module +lazy.setup("plugins") + +-- easy-access keybindings +require("helpers.keys").map("n", "L", lazy.show, "show lazy") -- cgit v1.2.3-70-g09d2