mirror of
https://github.com/LunarVim/LunarVim.git
synced 2024-09-20 10:35:08 +02:00
perf(toggleterm): on-demand lazy load (#3811)
* perf(toggleterm): on-demand lazy load * fix: keys * fix: move setup, on_config_done (for terminal obj) * fix: add some cmds * refactor: remove redundant `lazy = true`
This commit is contained in:
parent
baf71343f0
commit
fde46c4b16
2 changed files with 17 additions and 5 deletions
|
@ -77,10 +77,7 @@ local function get_dynamic_terminal_size(direction, size)
|
|||
end
|
||||
end
|
||||
|
||||
M.setup = function()
|
||||
local terminal = require "toggleterm"
|
||||
terminal.setup(lvim.builtin.terminal)
|
||||
|
||||
M.init = function()
|
||||
for i, exec in pairs(lvim.builtin.terminal.execs) do
|
||||
local direction = exec[4] or lvim.builtin.terminal.direction
|
||||
|
||||
|
@ -98,7 +95,11 @@ M.setup = function()
|
|||
|
||||
M.add_exec(opts)
|
||||
end
|
||||
end
|
||||
|
||||
M.setup = function()
|
||||
local terminal = require "toggleterm"
|
||||
terminal.setup(lvim.builtin.terminal)
|
||||
if lvim.builtin.terminal.on_config_done then
|
||||
lvim.builtin.terminal.on_config_done(terminal)
|
||||
end
|
||||
|
|
|
@ -280,11 +280,22 @@ local core_plugins = {
|
|||
-- Terminal
|
||||
{
|
||||
"akinsho/toggleterm.nvim",
|
||||
event = "VeryLazy",
|
||||
branch = "main",
|
||||
init = function()
|
||||
require("lvim.core.terminal").init()
|
||||
end,
|
||||
config = function()
|
||||
require("lvim.core.terminal").setup()
|
||||
end,
|
||||
cmd = {
|
||||
"ToggleTerm",
|
||||
"TermExec",
|
||||
"ToggleTermToggleAll",
|
||||
"ToggleTermSendCurrentLine",
|
||||
"ToggleTermSendVisualLines",
|
||||
"ToggleTermSendVisualSelection",
|
||||
},
|
||||
keys = lvim.builtin.terminal.open_mapping,
|
||||
enabled = lvim.builtin.terminal.active,
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue