nvim: Split up mini plugins for lazier loading
Split off base16 (instant load for themes) and starter (only load on empty start) from rest.
This commit is contained in:
parent
091274fd82
commit
020ec86481
2 changed files with 140 additions and 125 deletions
|
|
@ -45,7 +45,10 @@
|
|||
"mason.nvim": { "branch": "main", "commit": "7f265cd6ae56cecdd0aa50c8c73fc593b0604801" },
|
||||
"mcphub.nvim": { "branch": "main", "commit": "85a7a659fc82da1429a2241ab61e9ce07b3db374" },
|
||||
"mdeval.nvim": { "branch": "master", "commit": "0e1b248db174a9659a9ab16eb8c90ff3aec55264" },
|
||||
"mini.base16": { "branch": "main", "commit": "2eb2d2b889a8c861d1a66ec651bd0edb417d5c7f" },
|
||||
"mini.files": { "branch": "main", "commit": "49c855977e9f4821d1ed8179ed44fe098b93ea2a" },
|
||||
"mini.nvim": { "branch": "main", "commit": "94cae4660a8b2d95dbbd56e1fbc6fcfa2716d152" },
|
||||
"mini.starter": { "branch": "main", "commit": "d8038690eadf203a40863c3a9423df880a901d39" },
|
||||
"molten-nvim": { "branch": "main", "commit": "a286aa914d9a154bc359131aab788b5a077a5a99" },
|
||||
"neo-tree-jj.nvim": { "branch": "main", "commit": "c6534930c6f79893e12eafbb722ee23e6a83e80e" },
|
||||
"neo-tree.nvim": { "branch": "main", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" },
|
||||
|
|
@ -75,7 +78,6 @@
|
|||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "5b9067899ee6a2538891573500e8fd6ff008440f" },
|
||||
"otter.nvim": { "branch": "main", "commit": "f3a401851c25c64220dcf2470252a1adc28308d5" },
|
||||
"pantran.nvim": { "branch": "main", "commit": "b87c3ae48cba4659587fb75abd847e5b7a7c9ca0" },
|
||||
"peek.nvim": { "branch": "master", "commit": "5820d937d5414baea5f586dc2a3d912a74636e5b" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||
"quarto-nvim": { "branch": "main", "commit": "5325af3731ac9840b308791f08ad660958d76163" },
|
||||
|
|
|
|||
|
|
@ -109,9 +109,9 @@ return {
|
|||
},
|
||||
-- collection of plugins
|
||||
{
|
||||
"echasnovski/mini.nvim",
|
||||
"echasnovski/mini.base16",
|
||||
dependencies = { "rktjmp/fwatch.nvim" }, -- for colorscheme updating
|
||||
event = { "VeryLazy", "StartScreen" }, -- need to load pretty soon for Starter screen
|
||||
event = "VimEnter",
|
||||
config = function()
|
||||
-- automatic callback to invoke 'mini.base16' when colorscheme file is changed
|
||||
local colorsfile = vim.fn.stdpath("state") .. "/colorscheme.lua"
|
||||
|
|
@ -129,8 +129,12 @@ return {
|
|||
source_colors()
|
||||
end),
|
||||
})
|
||||
|
||||
-- this should be loaded as soon as the plugin is loaded
|
||||
end,
|
||||
},
|
||||
{
|
||||
"echasnovski/mini.starter",
|
||||
event = "StartScreen",
|
||||
config = function()
|
||||
local starter = require("mini.starter")
|
||||
starter.setup({
|
||||
evaluate_single = true,
|
||||
|
|
@ -153,6 +157,22 @@ return {
|
|||
starter.gen_hook.aligning("center", "center"),
|
||||
},
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>ss",
|
||||
function()
|
||||
require("mini.starter").open()
|
||||
end,
|
||||
silent = true,
|
||||
desc = "startpage",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"echasnovski/mini.files",
|
||||
event = { "VeryLazy" },
|
||||
config = function()
|
||||
require("mini.files").setup({
|
||||
mappings = {
|
||||
synchronize = "S",
|
||||
|
|
@ -169,15 +189,28 @@ return {
|
|||
pattern = "MiniFilesWindowUpdate",
|
||||
callback = function(args)
|
||||
local win_id = args.data.win_id
|
||||
|
||||
vim.wo[win_id].number = true
|
||||
end,
|
||||
})
|
||||
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>e",
|
||||
function()
|
||||
local mf = require("mini.files")
|
||||
if not mf.close() then
|
||||
mf.open()
|
||||
end
|
||||
end,
|
||||
desc = "floating file browser",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"echasnovski/mini.nvim",
|
||||
event = { "InsertEnter", "VeryLazy" },
|
||||
config = function()
|
||||
-- manually create lazy loading scenarios
|
||||
vim.api.nvim_create_autocmd({ "InsertEnter", "CursorHold" }, {
|
||||
once = true,
|
||||
callback = function()
|
||||
require("mini.ai").setup()
|
||||
-- Align tables and other alignable things
|
||||
require("mini.align").setup({})
|
||||
|
|
@ -191,7 +224,7 @@ return {
|
|||
indent = { suffix = "" }, -- disable since we use indentscope
|
||||
jump = { suffix = "j", options = {} },
|
||||
location = { suffix = "l", options = {} },
|
||||
oldfile = { suffix = "o", options = {} }, -- FIXME: overwritten by wrapping defaults currently
|
||||
oldfile = { suffix = "o", options = {} },
|
||||
quickfix = { suffix = "q", options = {} },
|
||||
treesitter = { suffix = "t", options = {} },
|
||||
undo = { suffix = "" }, -- disable since I don't need it
|
||||
|
|
@ -277,8 +310,6 @@ return {
|
|||
})
|
||||
require("mini.trailspace").setup()
|
||||
end,
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>sm",
|
||||
|
|
@ -288,14 +319,6 @@ return {
|
|||
silent = true,
|
||||
desc = "minimap",
|
||||
},
|
||||
{
|
||||
"<leader>ss",
|
||||
function()
|
||||
require("mini.starter").open()
|
||||
end,
|
||||
silent = true,
|
||||
desc = "startpage",
|
||||
},
|
||||
{
|
||||
"<localleader>w",
|
||||
function()
|
||||
|
|
@ -303,16 +326,6 @@ return {
|
|||
end,
|
||||
desc = "Trim trailing whitespace",
|
||||
},
|
||||
{
|
||||
"<leader>e",
|
||||
function()
|
||||
local mf = require("mini.files")
|
||||
if not mf.close() then
|
||||
mf.open()
|
||||
end
|
||||
end,
|
||||
desc = "floating file browser",
|
||||
},
|
||||
{
|
||||
"[si",
|
||||
function()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue