chg: Switch to lazy.nvim for plugins

This commit is contained in:
Sayantan Santra 2024-03-22 13:02:23 -05:00
parent 1b011fe67a
commit 7038f9145e
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F
7 changed files with 56 additions and 79 deletions

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
# Ignore lazy-lock files
lazy-lock.json

View file

@ -3,7 +3,7 @@ package.path = package.path .. ';' .. vim.fn.stdpath("config") .. "/?.lua"
-- Load global configs -- Load global configs
require("globals") require("globals")
-- Load plugins using paq-nvim -- Load plugins using lazy.nvim
require("plugins") require("plugins")
-- Load keymaps -- Load keymaps
require("keymaps") require("keymaps")

View file

@ -1,29 +1,19 @@
-- Automatically bootstrap paq-nvim -- Automatically bootstrap lazy.nvim
local function clone_paq() local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
local path = vim.fn.stdpath("data") .. "/site/pack/paqs/start/paq-nvim" if not vim.loop.fs_stat(lazypath) then
local is_installed = vim.fn.empty(vim.fn.glob(path)) == 0 vim.fn.system({
if not is_installed then "git",
vim.fn.system { "git", "clone", "--depth=1", "https://github.com/savq/paq-nvim.git", path } "clone",
return true "--filter=blob:none",
end "https://github.com/folke/lazy.nvim.git",
end "--branch=stable", -- latest stable release
lazypath,
-- Automatically install new packages at startup })
local function bootstrap_paq(packages)
local first_install = clone_paq()
vim.cmd.packadd("paq-nvim")
local paq = require("paq")
paq(packages)
if first_install then
vim.notify("Installing plugins... If prompted, hit Enter to continue.")
paq.install()
end
end end
vim.opt.rtp:prepend(lazypath)
-- Load plugin via paq-nvim -- Load plugin via paq-nvim
bootstrap_paq { require("lazy").setup({
-- Let paq-nvim manage itself
"savq/paq-nvim",
-- Use lualine for statusbar -- Use lualine for statusbar
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
"nvim-tree/nvim-web-devicons", "nvim-tree/nvim-web-devicons",
@ -46,9 +36,9 @@ bootstrap_paq {
"hrsh7th/cmp-cmdline", "hrsh7th/cmp-cmdline",
"SirVer/ultisnips", -- For snippets "SirVer/ultisnips", -- For snippets
-- Support programming terms -- Support programming terms
{ "psliwka/vim-dirtytalk", build = ':let &rtp = &rtp | DirtytalkUpdate' }, { "psliwka/vim-dirtytalk", build = ":DirtytalkUpdate" },
-- vim-moonfly theme -- vim-moonfly theme
{ "bluz71/vim-moonfly-colors", as = 'moonfly' }, { "bluz71/vim-moonfly-colors", as = "moonfly" },
-- Rust tools -- Rust tools
"simrat39/rust-tools.nvim", "simrat39/rust-tools.nvim",
-- Automatically add bracket pairs -- Automatically add bracket pairs
@ -61,5 +51,5 @@ bootstrap_paq {
"stevearc/conform.nvim", "stevearc/conform.nvim",
"junegunn/fzf.vim", "junegunn/fzf.vim",
"kylechui/nvim-surround", "kylechui/nvim-surround",
} })

View file

@ -3,7 +3,7 @@ package.path = package.path .. ';' .. vim.fn.stdpath("config") .. "/?.lua"
-- Load global configs -- Load global configs
require("globals") require("globals")
-- Load plugins using paq-nvim -- Load plugins using lazy.nvim
require("plugins") require("plugins")
-- Load keymaps -- Load keymaps
require("keymaps") require("keymaps")

View file

@ -1,27 +1,19 @@
-- Automatically bootstrap paq-nvim -- Automatically bootstrap lazy.nvim
local function clone_paq() local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
local path = vim.fn.stdpath("data") .. "/site/pack/paqs/start/paq-nvim" if not vim.loop.fs_stat(lazypath) then
local is_installed = vim.fn.empty(vim.fn.glob(path)) == 0 vim.fn.system({
if not is_installed then "git",
vim.fn.system { "git", "clone", "--depth=1", "https://github.com/savq/paq-nvim.git", path } "clone",
return true "--filter=blob:none",
end "https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end end
vim.opt.rtp:prepend(lazypath)
-- Automatically install new packages at startup -- Load plugins via lazy.nvim
local function bootstrap_paq(packages) require("lazy").setup({
local first_install = clone_paq()
vim.cmd.packadd("paq-nvim")
local paq = require("paq")
paq(packages)
if first_install then
vim.notify("Installing plugins... If prompted, hit Enter to continue.")
paq.install()
end
end
-- Load plugins via paq-nvim
bootstrap_paq {
-- Let paq-nvim manage itself -- Let paq-nvim manage itself
"savq/paq-nvim", "savq/paq-nvim",
-- Use lualine for statusbar -- Use lualine for statusbar
@ -41,9 +33,9 @@ bootstrap_paq {
"hrsh7th/cmp-buffer", "hrsh7th/cmp-buffer",
"hrsh7th/cmp-path", "hrsh7th/cmp-path",
-- Support programming terms -- Support programming terms
{ "psliwka/vim-dirtytalk", build = ':let &rtp = &rtp | DirtytalkUpdate' }, { "psliwka/vim-dirtytalk", build = ":DirtytalkUpdate" },
-- vim-moonfly theme -- vim-moonfly theme
{ "bluz71/vim-moonfly-colors", as = 'moonfly' }, { "bluz71/vim-moonfly-colors", as = "moonfly" },
-- Automatically add bracket pairs -- Automatically add bracket pairs
"windwp/nvim-autopairs", "windwp/nvim-autopairs",
-- Syntax highlighting for Caddyfile -- Syntax highlighting for Caddyfile
@ -53,5 +45,5 @@ bootstrap_paq {
"kylechui/nvim-surround", "kylechui/nvim-surround",
"junegunn/fzf", "junegunn/fzf",
"junegunn/fzf.vim", "junegunn/fzf.vim",
} })

View file

@ -3,7 +3,7 @@ package.path = package.path .. ';' .. vim.fn.stdpath("config") .. "/?.lua"
-- Load global configs -- Load global configs
require("globals") require("globals")
-- Load plugins using paq-nvim -- Load plugins using lazy.nvim
require("plugins") require("plugins")
-- Load keymaps -- Load keymaps
require("keymaps") require("keymaps")

View file

@ -1,27 +1,19 @@
-- Automatically bootstrap paq-nvim -- Automatically bootstrap lazy.nvim
local function clone_paq() local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
local path = vim.fn.stdpath("data") .. "/site/pack/paqs/start/paq-nvim" if not vim.loop.fs_stat(lazypath) then
local is_installed = vim.fn.empty(vim.fn.glob(path)) == 0 vim.fn.system({
if not is_installed then "git",
vim.fn.system { "git", "clone", "--depth=1", "https://github.com/savq/paq-nvim.git", path } "clone",
return true "--filter=blob:none",
end "https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end end
vim.opt.rtp:prepend(lazypath)
-- Automatically install new packages at startup -- Load plugins via lazy.nvim
local function bootstrap_paq(packages) require("lazy").setup({
local first_install = clone_paq()
vim.cmd.packadd("paq-nvim")
local paq = require("paq")
paq(packages)
if first_install then
vim.notify("Installing plugins... If prompted, hit Enter to continue.")
paq.install()
end
end
-- Load plugins via paq-nvim
bootstrap_paq {
-- Let paq-nvim manage itself -- Let paq-nvim manage itself
"savq/paq-nvim", "savq/paq-nvim",
-- Use lualine for statusbar -- Use lualine for statusbar
@ -41,9 +33,9 @@ bootstrap_paq {
"hrsh7th/cmp-path", "hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline", "hrsh7th/cmp-cmdline",
-- Support programming terms -- Support programming terms
{ "psliwka/vim-dirtytalk", build = ':let &rtp = &rtp | DirtytalkUpdate' }, { "psliwka/vim-dirtytalk", build = ":DirtytalkUpdate" },
-- vim-moonfly theme -- vim-moonfly theme
{ "bluz71/vim-moonfly-colors", as = 'moonfly' }, { "bluz71/vim-moonfly-colors", as = "moonfly" },
-- Automatically add bracket pairs -- Automatically add bracket pairs
"windwp/nvim-autopairs", "windwp/nvim-autopairs",
-- Syntax highlighting for Caddyfile -- Syntax highlighting for Caddyfile
@ -53,5 +45,5 @@ bootstrap_paq {
"kylechui/nvim-surround", "kylechui/nvim-surround",
"junegunn/fzf", "junegunn/fzf",
"junegunn/fzf.vim", "junegunn/fzf.vim",
} })