From b4b1ec8ff758cca482480bf75004f6d1de9e5c18 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Fri, 17 Feb 2023 10:13:18 +0000 Subject: [PATCH] Move lazy setup to init.lua, plugins.lua returns plugin spec --- config/nvim/init.lua | 21 ++++++++++++++++++--- config/nvim/lua/plugins.lua | 25 ++++++------------------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/config/nvim/init.lua b/config/nvim/init.lua index ba412d37..ce3ea4cf 100644 --- a/config/nvim/init.lua +++ b/config/nvim/init.lua @@ -1,9 +1,24 @@ +-- bootstrap lazy.nvim +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({ + require("plugins"), +}) + -- Set vim options require("options") --- Load plugins as defined for Packer -require("plugins") - -- Define custom keymappings require("keymaps") diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index c7576559..ce5a316f 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -1,28 +1,13 @@ --- bootstrap lazy.nvim -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) - -vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]]) - -require("lazy").setup({ +local M = { "folke/lazy.nvim", { "catppuccin/nvim", name = "catppuccin", + lazy = false, + priority = 1000, config = function() require("colours") end, - priority = 1000, }, "stevearc/dressing.nvim", { @@ -127,4 +112,6 @@ require("lazy").setup({ require("config.nvim-test") end, }, -}) + { "numToStr/Comment.nvim", name = "Comment" }, +} +return M