From d0fe35b0c95af071bbcea900bd38729842fd3071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Thu, 30 Nov 2023 13:22:20 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(nvim):=20avoid=20?= =?UTF-8?q?creating=20a=20variable=20for=20the=20onload=20function=20in=20?= =?UTF-8?q?the=20telescope=20extensions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/nvim/lua/plugins/extras/coding/refactoring.lua | 4 +--- .config/nvim/lua/plugins/extras/dap/telescope.lua | 4 +--- .config/nvim/lua/plugins/extras/editor/git/worktree.lua | 6 ++---- .config/nvim/lua/plugins/extras/editor/harpoon.lua | 4 +--- .config/nvim/lua/plugins/extras/editor/telescope/import.lua | 6 ++---- .config/nvim/lua/plugins/extras/editor/telescope/lazy.lua | 4 +--- .../nvim/lua/plugins/extras/editor/telescope/luasnip.lua | 4 +--- .config/nvim/lua/plugins/extras/editor/telescope/media.lua | 6 ++---- .config/nvim/lua/plugins/extras/editor/telescope/repo.lua | 6 ++---- .../nvim/lua/plugins/extras/editor/telescope/undotree.lua | 6 ++---- .config/nvim/lua/plugins/extras/editor/telescope/zoxide.lua | 6 ++---- .../nvim/lua/plugins/extras/editor/terminal/floaterm.lua | 4 +--- 12 files changed, 18 insertions(+), 42 deletions(-) diff --git a/.config/nvim/lua/plugins/extras/coding/refactoring.lua b/.config/nvim/lua/plugins/extras/coding/refactoring.lua index dce60c18..a9fe6941 100644 --- a/.config/nvim/lua/plugins/extras/coding/refactoring.lua +++ b/.config/nvim/lua/plugins/extras/coding/refactoring.lua @@ -1,5 +1,3 @@ -local Util = require("lazyvim.util") - return { "ThePrimeagen/refactoring.nvim", requires = { @@ -8,7 +6,7 @@ return { }, opts = {}, config = function(_, opts) - Util.on_load("telescope.nvim", function() + require("lazyvim.util").on_load("telescope.nvim", function() require("telescope").load_extension("refactoring") end) end, diff --git a/.config/nvim/lua/plugins/extras/dap/telescope.lua b/.config/nvim/lua/plugins/extras/dap/telescope.lua index 25ba5749..4de7baf2 100644 --- a/.config/nvim/lua/plugins/extras/dap/telescope.lua +++ b/.config/nvim/lua/plugins/extras/dap/telescope.lua @@ -1,9 +1,7 @@ -local Util = require("lazyvim.util") - return { "nvim-telescope/telescope-dap.nvim", config = function() - Util.on_load("telescope.nvim", function() + require("lazyvim.util").on_load("telescope.nvim", function() require("telescope").load_extension("dap") end) end, diff --git a/.config/nvim/lua/plugins/extras/editor/git/worktree.lua b/.config/nvim/lua/plugins/extras/editor/git/worktree.lua index 55519b24..155a0b79 100644 --- a/.config/nvim/lua/plugins/extras/editor/git/worktree.lua +++ b/.config/nvim/lua/plugins/extras/editor/git/worktree.lua @@ -1,11 +1,9 @@ -local Util = require("lazyvim.util") - return { { "ThePrimeagen/git-worktree.nvim", opts = {}, - config = function(_, opts) - Util.on_load("telescope.nvim", function() + config = function() + require("lazyvim.util").on_load("telescope.nvim", function() require("telescope").load_extension("git_worktree") end) end, diff --git a/.config/nvim/lua/plugins/extras/editor/harpoon.lua b/.config/nvim/lua/plugins/extras/editor/harpoon.lua index 62d8afb3..b42d6371 100644 --- a/.config/nvim/lua/plugins/extras/editor/harpoon.lua +++ b/.config/nvim/lua/plugins/extras/editor/harpoon.lua @@ -1,5 +1,3 @@ -local Util = require("lazyvim.util") - return { { "ThePrimeagen/harpoon", @@ -21,7 +19,7 @@ return { }, }, config = function() - Util.on_load("telescope.nvim", function() + require("lazyvim.util").on_load("telescope.nvim", function() require("telescope").load_extension("harpoon") end) end, diff --git a/.config/nvim/lua/plugins/extras/editor/telescope/import.lua b/.config/nvim/lua/plugins/extras/editor/telescope/import.lua index edd4998a..df857a50 100644 --- a/.config/nvim/lua/plugins/extras/editor/telescope/import.lua +++ b/.config/nvim/lua/plugins/extras/editor/telescope/import.lua @@ -1,10 +1,8 @@ -local Util = require("lazyvim.util") - return { "piersolenski/telescope-import.nvim", opts = {}, - config = function(_, opts) - Util.on_load("telescope.nvim", function() + config = function() + require("lazyvim.util").on_load("telescope.nvim", function() require("telescope").setup({ extensions = { import = { diff --git a/.config/nvim/lua/plugins/extras/editor/telescope/lazy.lua b/.config/nvim/lua/plugins/extras/editor/telescope/lazy.lua index ecfeaba9..6aeef49a 100644 --- a/.config/nvim/lua/plugins/extras/editor/telescope/lazy.lua +++ b/.config/nvim/lua/plugins/extras/editor/telescope/lazy.lua @@ -1,9 +1,7 @@ -local Util = require("lazyvim.util") - return { "tsakirist/telescope-lazy.nvim", config = function() - Util.on_load("telescope.nvim", function() + require("lazyvim.util").on_load("telescope.nvim", function() require("telescope").load_extension("lazy") end) end, diff --git a/.config/nvim/lua/plugins/extras/editor/telescope/luasnip.lua b/.config/nvim/lua/plugins/extras/editor/telescope/luasnip.lua index aaeabfaf..126d4890 100644 --- a/.config/nvim/lua/plugins/extras/editor/telescope/luasnip.lua +++ b/.config/nvim/lua/plugins/extras/editor/telescope/luasnip.lua @@ -1,9 +1,7 @@ -local Util = require("lazyvim.util") - return { "benfowler/telescope-luasnip.nvim", config = function() - Util.on_load("telescope.nvim", function() + require("lazyvim.util").on_load("telescope.nvim", function() require("telescope").load_extension("luasnip") end) end, diff --git a/.config/nvim/lua/plugins/extras/editor/telescope/media.lua b/.config/nvim/lua/plugins/extras/editor/telescope/media.lua index b8c459fe..1482dd8c 100644 --- a/.config/nvim/lua/plugins/extras/editor/telescope/media.lua +++ b/.config/nvim/lua/plugins/extras/editor/telescope/media.lua @@ -1,9 +1,7 @@ -local Util = require("lazyvim.util") - return { "dharmx/telescope-media.nvim", - config = function(_, opts) - Util.on_load("telescope.nvim", function() + config = function() + require("lazyvim.util").on_load("telescope.nvim", function() require("telescope").setup({ extensions = { media = { diff --git a/.config/nvim/lua/plugins/extras/editor/telescope/repo.lua b/.config/nvim/lua/plugins/extras/editor/telescope/repo.lua index efc11fc3..8dabf5d8 100644 --- a/.config/nvim/lua/plugins/extras/editor/telescope/repo.lua +++ b/.config/nvim/lua/plugins/extras/editor/telescope/repo.lua @@ -1,11 +1,9 @@ -local Util = require("lazyvim.util") - return { { "cljoly/telescope-repo.nvim", opts = {}, - config = function(_, opts) - Util.on_load("telescope.nvim", function() + config = function() + require("lazyvim.util").on_load("telescope.nvim", function() require("telescope").setup({ extensions = { repo = { diff --git a/.config/nvim/lua/plugins/extras/editor/telescope/undotree.lua b/.config/nvim/lua/plugins/extras/editor/telescope/undotree.lua index 93c200dd..bc840c9e 100644 --- a/.config/nvim/lua/plugins/extras/editor/telescope/undotree.lua +++ b/.config/nvim/lua/plugins/extras/editor/telescope/undotree.lua @@ -1,11 +1,9 @@ -local Util = require("lazyvim.util") - return { { "debugloop/telescope-undo.nvim", opts = {}, - config = function(_, opts) - Util.on_load("telescope.nvim", function() + config = function() + require("lazyvim.util").on_load("telescope.nvim", function() require("telescope").setup({ extensions = { undo = { diff --git a/.config/nvim/lua/plugins/extras/editor/telescope/zoxide.lua b/.config/nvim/lua/plugins/extras/editor/telescope/zoxide.lua index 03296602..eb11a2b6 100644 --- a/.config/nvim/lua/plugins/extras/editor/telescope/zoxide.lua +++ b/.config/nvim/lua/plugins/extras/editor/telescope/zoxide.lua @@ -1,10 +1,8 @@ -local Util = require("lazyvim.util") - return { { "jvgrootveld/telescope-zoxide", - config = function(_, opts) - Util.on_load("telescope.nvim", function() + config = function() + require("lazyvim.util").on_load("telescope.nvim", function() require("telescope").setup({ extensions = { zoxide = { diff --git a/.config/nvim/lua/plugins/extras/editor/terminal/floaterm.lua b/.config/nvim/lua/plugins/extras/editor/terminal/floaterm.lua index 94eb83af..c490a745 100644 --- a/.config/nvim/lua/plugins/extras/editor/terminal/floaterm.lua +++ b/.config/nvim/lua/plugins/extras/editor/terminal/floaterm.lua @@ -1,5 +1,3 @@ -local Util = require("lazyvim.util") - return { { "voldikss/vim-floaterm", @@ -36,7 +34,7 @@ return { { "dawsers/telescope-floaterm.nvim", config = function() - Util.on_load("telescope.nvim", function() + require("lazyvim.util").on_load("telescope.nvim", function() require("telescope").load_extension("floaterm") end) end,