From 60c7ad77fddf6d23a2427844f368d247fef1ed5a Mon Sep 17 00:00:00 2001 From: LostNeophyte Date: Sat, 4 Feb 2023 16:22:41 +0100 Subject: 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 Co-authored-by: Pratyush Bharati Co-authored-by: LostNeophyte * 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 <46706232+pr-313@users.noreply.github.com> Co-authored-by: Pratyush Bharati Co-authored-by: opalmay Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com> --- lua/lvim/core/telescope.lua | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'lua/lvim/core/telescope.lua') diff --git a/lua/lvim/core/telescope.lua b/lua/lvim/core/telescope.lua index a1b17e04..b701f7e4 100644 --- a/lua/lvim/core/telescope.lua +++ b/lua/lvim/core/telescope.lua @@ -7,21 +7,11 @@ local M = {} ---| "center" # retain the default telescope theme function M.config() - -- Define this minimal config so that it's available if telescope is not yet available. - + local actions = require("lvim.utils.modules").require_on_exported_call "telescope.actions" lvim.builtin.telescope = { ---@usage disable telescope completely [not recommended] active = true, on_config_done = nil, - } - - local ok, actions = pcall(require, "telescope.actions") - if not ok then - return - end - lvim.builtin.telescope = { - active = true, - on_config_done = nil, theme = "dropdown", ---@type telescope_themes defaults = { prompt_prefix = lvim.icons.ui.Telescope .. " ", @@ -51,13 +41,19 @@ function M.config() [""] = actions.close, [""] = actions.cycle_history_next, [""] = actions.cycle_history_prev, - [""] = actions.smart_send_to_qflist + actions.open_qflist, + [""] = function(...) + actions.smart_send_to_qflist(...) + actions.open_qflist(...) + end, [""] = actions.select_default, }, n = { [""] = actions.move_selection_next, [""] = actions.move_selection_previous, - [""] = actions.smart_send_to_qflist + actions.open_qflist, + [""] = function(...) + actions.smart_send_to_qflist(...) + actions.open_qflist(...) + end, }, }, file_ignore_patterns = {}, -- cgit v1.2.3