From 45bc8660ff1b2e6168977612e270a22bee3d862e Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Sat, 21 Sep 2024 14:18:05 -0400 Subject: [PATCH] Use lazy differently --- nvim/.config/nvim/init.lua | 2 +- nvim/.config/nvim/lua/config/lazy.lua | 34 +++++++++++++++++++ .../lua/{plugins.lua => plugins/current.lua} | 16 ++------- 3 files changed, 37 insertions(+), 15 deletions(-) create mode 100644 nvim/.config/nvim/lua/config/lazy.lua rename nvim/.config/nvim/lua/{plugins.lua => plugins/current.lua} (62%) diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index f5a013e..e6818c1 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -1,3 +1,3 @@ require "options" -require "plugins" +require "config.lazy" require "config" diff --git a/nvim/.config/nvim/lua/config/lazy.lua b/nvim/.config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..b24cc41 --- /dev/null +++ b/nvim/.config/nvim/lua/config/lazy.lua @@ -0,0 +1,34 @@ +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", + lazypath + }) +end +vim.opt.rtp:prepend(vim.env.LAZY or lazypath) + +require("lazy").setup({ + spec = { + {import = "plugins"}, + }, + defaults = { + lazy = false, + version = false, + }, + checker = {enabled = false}, + performance = { + rtp = { + disabled_plugins = { + "gzip", + "tarPlugin", + "tohtml", + "tutor", + "zipPlugin", + }, + }, + }, +}) diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins/current.lua similarity index 62% rename from nvim/.config/nvim/lua/plugins.lua rename to nvim/.config/nvim/lua/plugins/current.lua index b533ece..3007c62 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins/current.lua @@ -1,16 +1,4 @@ -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) -require("lazy").setup({ +return { "nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim", "famiu/bufdelete.nvim", @@ -34,4 +22,4 @@ require("lazy").setup({ "tpope/vim-markdown", "tpope/vim-rails", "vim-ruby/vim-ruby", -}) +}