From 4bf79169f7f3a3f31b8334083e0c5f5d4d6689d2 Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Fri, 6 Nov 2026 09:58:19 -0500 Subject: [PATCH] feat(plugins): add ghq-backed project picker shortcut --- lua/plugins/astrocore.lua | 5 +++++ lua/plugins/user.lua | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/lua/plugins/astrocore.lua b/lua/plugins/astrocore.lua index 9c2bfbc..371388e 100644 --- a/lua/plugins/astrocore.lua +++ b/lua/plugins/astrocore.lua @@ -280,6 +280,11 @@ return { function() require("snacks").picker.smart() end, desc = "Find files", }, + -- needs a terminal that reports distinctly (kitty keyboard protocol) + [""] = { + function() require("snacks").picker.projects() end, + desc = "Find projects", + }, ["b"] = { "BufferLinePick", desc = "Pick buffer" }, ["f"] = { function() require("snacks").picker.buffers() end, diff --git a/lua/plugins/user.lua b/lua/plugins/user.lua index 7c034bd..4e54d17 100644 --- a/lua/plugins/user.lua +++ b/lua/plugins/user.lua @@ -40,6 +40,19 @@ picker_sources.smart.config = function(opts) return opts end +-- Projects picker (fp, p, ): when the ghq +-- CLI is installed, every `ghq list -p` repo joins the recent/dev projects. +-- Resolved at open time so newly cloned repos show up without a restart. +picker_sources.projects = { + config = function(opts) + if vim.fn.executable "ghq" == 1 then + local repos = vim.fn.systemlist { "ghq", "list", "-p" } + if vim.v.shell_error == 0 then opts.projects = vim.list_extend(vim.list_slice(opts.projects or {}), repos) end + end + return opts + end, +} + ---@type LazySpec return { { "sphamba/smear-cursor.nvim", event = "VeryLazy", opts = {} },