From 85e6e43d932732d2485abf31a18b4bcd3be46ccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Thu, 28 Dec 2023 14:31:52 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(nvim):=20added=20workspaces=20?= =?UTF-8?q?extra?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/nvim/.github/README.md | 2 + .../extras/editor/telescope/workspaces.lua | 56 +++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .config/nvim/lua/plugins/extras/editor/telescope/workspaces.lua diff --git a/.config/nvim/.github/README.md b/.config/nvim/.github/README.md index fe5a5cb3..ee2cd680 100644 --- a/.config/nvim/.github/README.md +++ b/.config/nvim/.github/README.md @@ -356,6 +356,8 @@ 📂 Project - [ahmedkhalf/project.nvim](https://dotfyle.com/plugins/ahmedkhalf/project.nvim) +- [natecraddock/workspaces.nvim](https://dotfyle.com/plugins/natecraddock/workspaces.nvim) +- [cljoly/telescope-repo.nvim](https://github.com/cljoly/telescope-repo.nvim) diff --git a/.config/nvim/lua/plugins/extras/editor/telescope/workspaces.lua b/.config/nvim/lua/plugins/extras/editor/telescope/workspaces.lua new file mode 100644 index 00000000..b647e10f --- /dev/null +++ b/.config/nvim/lua/plugins/extras/editor/telescope/workspaces.lua @@ -0,0 +1,56 @@ +return { + { + "natecraddock/workspaces.nvim", + event = "VeryLazy", + cmd = { + "Telescope workspaces", + "WorkspacesAdd", + "WorkspacesAddDir", + "WorkspacesRemove", + "WorkspacesRename", + "WorkspacesOpen", + "WorkspacesList", + "WorkspacesListDirs", + }, + config = function() + require("workspaces").setup({ + hooks = { + open = { "Telescope find_files" }, + }, + }) + require("lazyvim.util").on_load("telescope.nvim", function() + require("telescope").load_extension("workspaces") + end) + end, + keys = { + { "fw", "Telescope workspaces", desc = "Workspaces" }, + }, + }, + { + "goolord/alpha-nvim", + optional = true, + opts = function(_, dashboard) + local button = dashboard.button("w", "󰭤 " .. " Workspaces", "Telescope workspaces") + button.opts.hl = "AlphaButtons" + button.opts.hl_shortcut = "AlphaShortcut" + table.insert(dashboard.section.buttons.val, 4, button) + end, + }, + { + "nvimdev/dashboard-nvim", + optional = true, + opts = function(_, opts) + local projects = { + action = "Telescope workspaces", + desc = " Workspaces", + icon = "󰭤 ", + key = "w", + } + + projects.desc = projects.desc .. string.rep(" ", 43 - #projects.desc) + projects.key_format = " %s" + + table.insert(opts.config.center, 4, projects) + end, + }, +}