nvim: Improve lazy-loading of select plugins
Aerial (on command), test-runners (on python only) and other plugins are now only loaded when actually required.
This commit is contained in:
parent
643deaebec
commit
8b603b8c66
7 changed files with 70 additions and 23 deletions
|
|
@ -33,7 +33,6 @@ return {
|
|||
config = function()
|
||||
require("plugins.config.toggleterm")
|
||||
end,
|
||||
lazy = false,
|
||||
cmd = { "ToggleTerm", "TermExec", "Lazygit", "Pythonterm" },
|
||||
},
|
||||
-- colorschemes
|
||||
|
|
@ -43,4 +42,10 @@ return {
|
|||
priority = 1000,
|
||||
dependencies = { "rktjmp/fwatch.nvim" },
|
||||
},
|
||||
-- try to avoid putting files in util buffers, e.g. filetree, aerial, undotree, ..
|
||||
{
|
||||
'stevearc/stickybuf.nvim',
|
||||
config = true,
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,4 +55,27 @@ return {
|
|||
ft = { "quarto", "python" },
|
||||
lazy = false,
|
||||
},
|
||||
|
||||
-- MARKDOWN ONLY
|
||||
-- Evaluate markdown code blocks
|
||||
{
|
||||
"jubnzv/mdeval.nvim",
|
||||
cmd = {
|
||||
"MdEval",
|
||||
},
|
||||
ft = { "markdown" },
|
||||
opts = {
|
||||
require_confirmation = false,
|
||||
eval_options = {},
|
||||
},
|
||||
lazy = false,
|
||||
},
|
||||
{
|
||||
"AckslD/nvim-FeMaco.lua",
|
||||
cmd = {
|
||||
"FeMaco"
|
||||
},
|
||||
ft = { "markdown" },
|
||||
config = true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,6 @@ return {
|
|||
},
|
||||
})
|
||||
end,
|
||||
event = "VeryLazy",
|
||||
event = "InsertEnter",
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,20 @@ return {
|
|||
"nvim-treesitter/nvim-treesitter",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
event = "VeryLazy",
|
||||
cmd = {
|
||||
"AerialToggle",
|
||||
"AerialOpen",
|
||||
"AerialOpenAll",
|
||||
"AerialClose",
|
||||
"AerialCloseAll",
|
||||
"AerialNext",
|
||||
"AerialPrev",
|
||||
"AerialGo",
|
||||
"AerialInfo",
|
||||
"AerialNavToggle",
|
||||
"AerialNavOpen",
|
||||
"AerialNavClose",
|
||||
},
|
||||
opts = {
|
||||
backends = { "treesitter", "lsp", "markdown", "man" },
|
||||
},
|
||||
|
|
@ -103,7 +116,7 @@ return {
|
|||
require("neotest").setup({
|
||||
adapters = {
|
||||
require("neotest-python")({
|
||||
-- with coverage requires coverage.py and pytest-cov installed
|
||||
-- with coverage requires coverage.py and pytest-cov installed
|
||||
args = { "--cov" },
|
||||
}),
|
||||
},
|
||||
|
|
@ -113,6 +126,7 @@ return {
|
|||
wk.register({ ["<localleader>t"] = { name = "+test" } })
|
||||
end
|
||||
end,
|
||||
ft = { "python" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>st",
|
||||
|
|
@ -179,9 +193,10 @@ return {
|
|||
},
|
||||
config = function()
|
||||
require("coverage").setup({
|
||||
lang = { python = { coverage_command = "poetry run coverage json -q -o -" } } ,
|
||||
lang = { python = { coverage_command = "poetry run coverage json -q -o -" } },
|
||||
})
|
||||
end,
|
||||
ft = { "python" },
|
||||
cmd = {
|
||||
"Coverage",
|
||||
"CoverageLoad",
|
||||
|
|
@ -211,6 +226,6 @@ return {
|
|||
desc = "show coverage summary",
|
||||
silent = true,
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,16 @@ return {
|
|||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
config = true, event = "VeryLazy",
|
||||
config = true,
|
||||
keys = {
|
||||
{
|
||||
"<leader>su",
|
||||
function()
|
||||
require("undotree").toggle()
|
||||
end,
|
||||
desc = "toggle undotree",
|
||||
silent = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue