summaryrefslogtreecommitdiff
path: root/lua/lvim/core/lir.lua
diff options
context:
space:
mode:
authorLostNeophyte <[email protected]>2023-02-04 16:22:41 +0100
committerGitHub <[email protected]>2023-02-04 17:22:41 +0200
commit60c7ad77fddf6d23a2427844f368d247fef1ed5a (patch)
tree1af3e0387c31134b2f25a1569824aa5590c60b43 /lua/lvim/core/lir.lua
parentc18cd3f0a89443d4265f6df8ce12fb89d627f09e (diff)
perf: lazy load most plugins (#3750)
* perf: lazy load most plugins * fix(lazy): suggested fixes for pref/lazyloading branch (#3754) fix(lazy): Suggested fixes from previous comments fix(lazy): applying suggestions from code review Co-authored-by: LostNeophyte <[email protected]> Co-authored-by: Pratyush Bharati <[email protected]> Co-authored-by: LostNeophyte <[email protected]> * chore: format * move lazy utils to modules.lua * simplify telescope actions * refactor: cmp_window local name * feat: more lazy loading cmds * refactor(cmp): minor clean up * perf: set lazy loading by default * refactor(alpha): remove broken lazy load * revert: explictily set lazy loading This reverts commit ba38193e4ebfa5acc8afa2b35247c5420d9a2739. * test: enable lazy-loading for bigfile * perf: defer projects and alpha to VimEnter * refactor(bufferline): add comment * perf: better lazy load dap/dapui * perf: lazy load ts-commentstring with Comment.nvim pre_hook --------- Co-authored-by: pr-313 <[email protected]> Co-authored-by: Pratyush Bharati <[email protected]> Co-authored-by: opalmay <[email protected]> Co-authored-by: kylo252 <[email protected]>
Diffstat (limited to 'lua/lvim/core/lir.lua')
-rw-r--r--lua/lvim/core/lir.lua21
1 files changed, 7 insertions, 14 deletions
diff --git a/lua/lvim/core/lir.lua b/lua/lvim/core/lir.lua
index 9f915ed2..83f79b6f 100644
--- a/lua/lvim/core/lir.lua
+++ b/lua/lvim/core/lir.lua
@@ -1,22 +1,14 @@
local M = {}
M.config = function()
+ local utils = require "lvim.utils.modules"
+ local actions = utils.require_on_exported_call "lir.actions"
+ local clipboard_actions = utils.require_on_exported_call "lir.clipboard.actions"
+
lvim.builtin.lir = {
active = true,
on_config_done = nil,
icon = "î—¿",
- }
-
- local status_ok, _ = pcall(require, "lir")
- if not status_ok then
- return
- end
-
- local actions = require "lir.actions"
- local mark_actions = require "lir.mark.actions"
- local clipboard_actions = require "lir.clipboard.actions"
-
- lvim.builtin.lir = vim.tbl_extend("force", lvim.builtin.lir, {
show_hidden_files = false,
ignore = {}, -- { ".DS_Store" "node_modules" } etc.
devicons = {
@@ -42,7 +34,7 @@ M.config = function()
["d"] = actions.delete,
["J"] = function()
- mark_actions.toggle_mark()
+ require("lir.mark.actions").toggle_mark()
vim.cmd "normal! j"
end,
["c"] = clipboard_actions.copy,
@@ -79,7 +71,7 @@ M.config = function()
{ noremap = true, silent = true }
)
end,
- })
+ }
end
function M.icon_setup()
@@ -118,6 +110,7 @@ function M.setup()
end
lir.setup(lvim.builtin.lir)
+ M.icon_setup()
if lvim.builtin.lir.on_config_done then
lvim.builtin.lir.on_config_done(lir)