From ef40dfcbc192c8aca6862350ab5860ac269d9fd7 Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Sun, 22 Aug 2021 13:15:25 +0530 Subject: [PATCH] plugins: Properly lazy load telescope from packer docs module = string or list -- Specifies Lua module names for require. When requiring a string which starts -- with one of these module names, the plugin will be loaded. --- lua/plugins/init.lua | 72 +++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 2068684..1701b08 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -73,41 +73,6 @@ return packer.startup(function() end, } - use { - "nvim-telescope/telescope.nvim", - after = "plenary.nvim", - requires = { - { - "sudormrfbin/cheatsheet.nvim", - disable = not plugin_status.cheatsheet, - after = "telescope.nvim", - config = function() - require "plugins.configs.chadsheet" - end, - setup = function() - require("core.mappings").chadsheet() - end, - }, - { - "nvim-telescope/telescope-fzf-native.nvim", - run = "make", - }, - { - "nvim-telescope/telescope-media-files.nvim", - disable = not plugin_status.telescope_media, - setup = function() - require("core.mappings").telescope_media() - end, - }, - }, - config = function() - require "plugins.configs.telescope" - end, - setup = function() - require("core.mappings").telescope() - end, - } - -- load autosave only if its globally enabled use { disable = not plugin_status.autosave, @@ -291,6 +256,43 @@ return packer.startup(function() end, } + use { + "nvim-telescope/telescope.nvim", + cmd = "Telescope", + -- because cheatsheet is not activated by a teleacope command + module = "cheatsheet", + requires = { + { + "sudormrfbin/cheatsheet.nvim", + disable = not plugin_status.cheatsheet, + after = "telescope.nvim", + config = function() + require "plugins.configs.chadsheet" + end, + setup = function() + require("core.mappings").chadsheet() + end, + }, + { + "nvim-telescope/telescope-fzf-native.nvim", + run = "make", + }, + { + "nvim-telescope/telescope-media-files.nvim", + disable = not plugin_status.telescope_media, + setup = function() + require("core.mappings").telescope_media() + end, + }, + }, + config = function() + require "plugins.configs.telescope" + end, + setup = function() + require("core.mappings").telescope() + end, + } + use { "Pocco81/TrueZen.nvim", disable = not plugin_status.truezen,