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
|
@ -180,8 +180,6 @@ map("n", "<localleader>q", "gqap", { silent = true, desc = "Format current parag
|
||||||
map("x", "<localleader>q", "gq", { silent = true, desc = "Format {motion}" })
|
map("x", "<localleader>q", "gq", { silent = true, desc = "Format {motion}" })
|
||||||
map("n", "<localleader>Q", "vapJgqap", { silent = true, desc = "Unformat then format paragraph" })
|
map("n", "<localleader>Q", "vapJgqap", { silent = true, desc = "Unformat then format paragraph" })
|
||||||
|
|
||||||
map("n", "<localleader>mp", "<Plug>MarkdownPreviewToggle", { desc = "Toggle md preview" })
|
|
||||||
|
|
||||||
-- FORMAT code with
|
-- FORMAT code with
|
||||||
-- PLUGIN: formatter.nvim
|
-- PLUGIN: formatter.nvim
|
||||||
map("n", "<localleader>f", ":FormatLock<cr>")
|
map("n", "<localleader>f", ":FormatLock<cr>")
|
||||||
|
@ -205,6 +203,7 @@ map("n", "<leader>ss", ":lua MiniStarter.open()<cr>", { desc = "show startpage"
|
||||||
|
|
||||||
-- PLUGIN: symbols-outline.nvim
|
-- PLUGIN: symbols-outline.nvim
|
||||||
map("n", "<leader>so", "<cmd>AerialToggle<cr>", { silent = true, desc = "toggle symbol outline" })
|
map("n", "<leader>so", "<cmd>AerialToggle<cr>", { silent = true, desc = "toggle symbol outline" })
|
||||||
|
map("n", "<leader>sn", "<cmd>AerialNavToggle<cr>", { silent = true, desc = "toggle symbol navigator" })
|
||||||
|
|
||||||
-- PLUGIN: nvim-tree
|
-- PLUGIN: nvim-tree
|
||||||
map("n", "<leader>se", "<cmd>NvimTreeToggle<cr>", { silent = true, desc = "toggle filetree" })
|
map("n", "<leader>se", "<cmd>NvimTreeToggle<cr>", { silent = true, desc = "toggle filetree" })
|
||||||
|
@ -255,13 +254,11 @@ map("v", "<localleader>nf", ":ZkMatch<cr>", { desc = "find note from selection"
|
||||||
-- PLUGIN: toggleterm.nvim
|
-- PLUGIN: toggleterm.nvim
|
||||||
-- create a lazygit or python window, set up in toggleterm settings
|
-- create a lazygit or python window, set up in toggleterm settings
|
||||||
-- TODO create ability to go into python environment when in poetry venv and/or euporie/jupyter notebook
|
-- TODO create ability to go into python environment when in poetry venv and/or euporie/jupyter notebook
|
||||||
if is_available("nvim-toggleterm.lua") then
|
prefix({ ["<localleader>t"] = { name = "+term" } })
|
||||||
map("n", "<leader>G", ":Lazygit<cr>")
|
map("n", "<leader>tg", ":Lazygit<cr>")
|
||||||
map("n", "<leader>tg", ":Lazygit<cr>")
|
map("n", "<leader>tG", ":Lazygit!<cr>")
|
||||||
map("n", "<leader>tG", ":Lazygit!<cr>")
|
map("n", "<leader>tp", ":Pythonterm<cr>")
|
||||||
map("n", "<leader>tp", ":Pythonterm<cr>")
|
map("n", "<leader>tP", ":Pythonterm!<cr>")
|
||||||
map("n", "<leader>tP", ":Pythonterm!<cr>")
|
|
||||||
end
|
|
||||||
|
|
||||||
prefix({ ["<localleader>s"] = { name = "+set" } })
|
prefix({ ["<localleader>s"] = { name = "+set" } })
|
||||||
-- PLUGIN: wrapping.nvim
|
-- PLUGIN: wrapping.nvim
|
||||||
|
@ -281,10 +278,3 @@ map(
|
||||||
)
|
)
|
||||||
|
|
||||||
map("n", "<leader>sa", "<cmd>FormatOnSave<cr>", { silent = true, desc = "toggle format on save" })
|
map("n", "<leader>sa", "<cmd>FormatOnSave<cr>", { silent = true, desc = "toggle format on save" })
|
||||||
|
|
||||||
-- PLUGIN: undotree
|
|
||||||
if is_available("undotree") then
|
|
||||||
map("n", "<leader>su", function()
|
|
||||||
require("undotree").toggle()
|
|
||||||
end, { silent = true, desc = "toggle undotree" })
|
|
||||||
end
|
|
||||||
|
|
|
@ -33,7 +33,6 @@ return {
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.config.toggleterm")
|
require("plugins.config.toggleterm")
|
||||||
end,
|
end,
|
||||||
lazy = false,
|
|
||||||
cmd = { "ToggleTerm", "TermExec", "Lazygit", "Pythonterm" },
|
cmd = { "ToggleTerm", "TermExec", "Lazygit", "Pythonterm" },
|
||||||
},
|
},
|
||||||
-- colorschemes
|
-- colorschemes
|
||||||
|
@ -43,4 +42,10 @@ return {
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
dependencies = { "rktjmp/fwatch.nvim" },
|
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" },
|
ft = { "quarto", "python" },
|
||||||
lazy = false,
|
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,
|
end,
|
||||||
event = "VeryLazy",
|
event = "InsertEnter",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,20 @@ return {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
"nvim-tree/nvim-web-devicons",
|
"nvim-tree/nvim-web-devicons",
|
||||||
},
|
},
|
||||||
event = "VeryLazy",
|
cmd = {
|
||||||
|
"AerialToggle",
|
||||||
|
"AerialOpen",
|
||||||
|
"AerialOpenAll",
|
||||||
|
"AerialClose",
|
||||||
|
"AerialCloseAll",
|
||||||
|
"AerialNext",
|
||||||
|
"AerialPrev",
|
||||||
|
"AerialGo",
|
||||||
|
"AerialInfo",
|
||||||
|
"AerialNavToggle",
|
||||||
|
"AerialNavOpen",
|
||||||
|
"AerialNavClose",
|
||||||
|
},
|
||||||
opts = {
|
opts = {
|
||||||
backends = { "treesitter", "lsp", "markdown", "man" },
|
backends = { "treesitter", "lsp", "markdown", "man" },
|
||||||
},
|
},
|
||||||
|
@ -103,7 +116,7 @@ return {
|
||||||
require("neotest").setup({
|
require("neotest").setup({
|
||||||
adapters = {
|
adapters = {
|
||||||
require("neotest-python")({
|
require("neotest-python")({
|
||||||
-- with coverage requires coverage.py and pytest-cov installed
|
-- with coverage requires coverage.py and pytest-cov installed
|
||||||
args = { "--cov" },
|
args = { "--cov" },
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
@ -113,6 +126,7 @@ return {
|
||||||
wk.register({ ["<localleader>t"] = { name = "+test" } })
|
wk.register({ ["<localleader>t"] = { name = "+test" } })
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
ft = { "python" },
|
||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
"<leader>st",
|
"<leader>st",
|
||||||
|
@ -179,9 +193,10 @@ return {
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require("coverage").setup({
|
require("coverage").setup({
|
||||||
lang = { python = { coverage_command = "poetry run coverage json -q -o -" } } ,
|
lang = { python = { coverage_command = "poetry run coverage json -q -o -" } },
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
ft = { "python" },
|
||||||
cmd = {
|
cmd = {
|
||||||
"Coverage",
|
"Coverage",
|
||||||
"CoverageLoad",
|
"CoverageLoad",
|
||||||
|
@ -211,6 +226,6 @@ return {
|
||||||
desc = "show coverage summary",
|
desc = "show coverage summary",
|
||||||
silent = true,
|
silent = true,
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,16 @@ return {
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
},
|
},
|
||||||
config = true, event = "VeryLazy",
|
config = true,
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>su",
|
||||||
|
function()
|
||||||
|
require("undotree").toggle()
|
||||||
|
end,
|
||||||
|
desc = "toggle undotree",
|
||||||
|
silent = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -186,3 +186,7 @@ Gitea
|
||||||
caramelization
|
caramelization
|
||||||
Maillard
|
Maillard
|
||||||
individualities
|
individualities
|
||||||
|
vaccilation
|
||||||
|
SSCM
|
||||||
|
GSCM
|
||||||
|
multicriteria
|
||||||
|
|
Loading…
Reference in a new issue