feat(nvim): lazy-load

This commit is contained in:
Barrett Ruth 2026-03-01 12:29:33 -05:00
parent 8e9d8cd00d
commit 6f664a27bd
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
9 changed files with 38 additions and 34 deletions

View file

@ -2,7 +2,7 @@ vim.g.mapleader = ' '
vim.g.lz_n = { vim.g.lz_n = {
load = function(name) load = function(name)
vim.cmd('packadd! ' .. name) vim.cmd('packadd! ' .. (name:match('[^/]+$') or name))
end, end,
} }

View file

@ -1,10 +1,10 @@
vim.pack.add({ vim.pack.add({
'https://github.com/saghen/blink.cmp', { src = 'https://github.com/saghen/blink.cmp', load = false },
'https://github.com/Kaiser-Yang/blink-cmp-git', { src = 'https://github.com/Kaiser-Yang/blink-cmp-git', load = false },
'https://github.com/bydlw98/blink-cmp-env', { src = 'https://github.com/bydlw98/blink-cmp-env', load = false },
'https://github.com/barrettruth/blink-cmp-ssh', { src = 'https://github.com/barrettruth/blink-cmp-ssh', load = false },
'https://github.com/barrettruth/blink-cmp-tmux', { src = 'https://github.com/barrettruth/blink-cmp-tmux', load = false },
'https://github.com/barrettruth/blink-cmp-ghostty', { src = 'https://github.com/barrettruth/blink-cmp-ghostty', load = false },
}) })
local pack_dir = vim.fn.stdpath('data') .. '/site/pack/core/opt' local pack_dir = vim.fn.stdpath('data') .. '/site/pack/core/opt'

View file

@ -1,11 +1,20 @@
local dev_plugins = { local dev_plugins = {
['diffs.nvim'] = '~/dev/diffs.nvim', 'midnight.nvim',
['canola.nvim'] = '~/dev/canola.nvim', 'live-server.nvim',
['pending.nvim'] = '~/dev/pending.nvim', 'nonicons.nvim',
'canola.nvim',
'pending.nvim',
'cp.nvim',
'diffs.nvim',
} }
for _, path in pairs(dev_plugins) do local opt_dir = vim.fn.stdpath('data') .. '/site/pack/dev/opt/'
vim.opt.rtp:prepend(path) vim.fn.mkdir(opt_dir, 'p')
for _, name in ipairs(dev_plugins) do
local link = opt_dir .. name
if not vim.uv.fs_lstat(link) then
vim.uv.fs_symlink(vim.fn.expand('~/dev/' .. name), link)
end
end end
local function parse_output(proc) local function parse_output(proc)
@ -176,11 +185,6 @@ local function insert_template(buf, lang, platform)
return true return true
end end
vim.pack.add({
'https://github.com/barrettruth/cp.nvim',
'https://github.com/nvim-tree/nvim-web-devicons',
})
return { return {
{ {
'barrettruth/midnight.nvim', 'barrettruth/midnight.nvim',

View file

@ -1,5 +1,5 @@
vim.pack.add({ vim.pack.add({
'https://github.com/ibhagwan/fzf-lua', { src = 'https://github.com/ibhagwan/fzf-lua', load = false },
}) })
return { return {

View file

@ -1,5 +1,5 @@
vim.pack.add({ vim.pack.add({
'https://github.com/tpope/vim-fugitive', { src = 'https://github.com/tpope/vim-fugitive', load = false },
{ src = 'https://github.com/lewis6991/gitsigns.nvim', load = false }, { src = 'https://github.com/lewis6991/gitsigns.nvim', load = false },
}) })

View file

@ -1,6 +1,6 @@
vim.pack.add({ vim.pack.add({
'https://github.com/nvimdev/guard.nvim', { src = 'https://github.com/nvimdev/guard.nvim', load = false },
'https://github.com/nvimdev/guard-collection', { src = 'https://github.com/nvimdev/guard-collection', load = false },
}) })
return { return {

View file

@ -1,7 +1,7 @@
vim.pack.add({ vim.pack.add({
'https://github.com/neovim/nvim-lspconfig', 'https://github.com/neovim/nvim-lspconfig',
'https://github.com/folke/lazydev.nvim', { src = 'https://github.com/folke/lazydev.nvim', load = false },
'https://github.com/saecki/live-rename.nvim', { src = 'https://github.com/saecki/live-rename.nvim', load = false },
}) })
return { return {

View file

@ -1,14 +1,14 @@
vim.pack.add({ vim.pack.add({
'https://github.com/echasnovski/mini.ai', { src = 'https://github.com/echasnovski/mini.ai', load = false },
'https://github.com/monaqa/dial.nvim', { src = 'https://github.com/monaqa/dial.nvim', load = false },
'https://github.com/catgoose/nvim-colorizer.lua', { src = 'https://github.com/catgoose/nvim-colorizer.lua', load = false },
'https://github.com/echasnovski/mini.pairs', { src = 'https://github.com/echasnovski/mini.pairs', load = false },
'https://github.com/echasnovski/mini.misc', { src = 'https://github.com/echasnovski/mini.misc', load = false },
'https://github.com/nvim-mini/mini.bufremove', { src = 'https://github.com/nvim-mini/mini.bufremove', load = false },
'https://github.com/tpope/vim-abolish', { src = 'https://github.com/tpope/vim-abolish', load = false },
'https://github.com/tpope/vim-sleuth', { src = 'https://github.com/tpope/vim-sleuth', load = false },
'https://github.com/kylechui/nvim-surround', { src = 'https://github.com/kylechui/nvim-surround', load = false },
'https://github.com/lervag/vimtex', { src = 'https://github.com/lervag/vimtex', load = false },
}) })
return { return {

View file

@ -1,7 +1,7 @@
vim.pack.add({ vim.pack.add({
'https://github.com/nvim-treesitter/nvim-treesitter', 'https://github.com/nvim-treesitter/nvim-treesitter',
'https://github.com/nvim-treesitter/nvim-treesitter-textobjects', 'https://github.com/nvim-treesitter/nvim-treesitter-textobjects',
'https://github.com/Wansmer/treesj', { src = 'https://github.com/Wansmer/treesj', load = false },
}) })
vim.api.nvim_create_autocmd('PackChanged', { vim.api.nvim_create_autocmd('PackChanged', {