From de07e34d87ed2efe6933c8f95e76ffbd899a41df Mon Sep 17 00:00:00 2001 From: PattyC Date: Mon, 10 Nov 2025 13:19:22 +0930 Subject: [PATCH] feat: add snacks gh plugin for GitHub issues and PRs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds GitHub integration using snacks.nvim gh module to browse and manage issues and pull requests directly from Neovim. Includes keybindings for viewing open and all issues/PRs under the g prefix. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- nvim/lua/config/keys.lua | 24 ++++++++++++++++++++++++ nvim/lua/core/configs/snacks.lua | 2 ++ nvim/lua/core/configs/snacks_gh.lua | 4 ++++ 3 files changed, 30 insertions(+) create mode 100644 nvim/lua/core/configs/snacks_gh.lua diff --git a/nvim/lua/config/keys.lua b/nvim/lua/config/keys.lua index 0797519..dd725ec 100644 --- a/nvim/lua/config/keys.lua +++ b/nvim/lua/config/keys.lua @@ -47,6 +47,30 @@ M.keymaps = { command = function() require("snacks").gitbrowse() end, opts = { desc = "Open commit line(s) in browser" }, }, + { + mode = "n", + keys = "gi", + command = function() require("snacks").picker.gh_issue() end, + opts = { desc = "GitHub Issues (open)" }, + }, + { + mode = "n", + keys = "gI", + command = function() require("snacks").picker.gh_issue({ state = "all" }) end, + opts = { desc = "GitHub Issues (all)" }, + }, + { + mode = "n", + keys = "gp", + command = function() require("snacks").picker.gh_pr() end, + opts = { desc = "GitHub Pull Requests (open)" }, + }, + { + mode = "n", + keys = "gP", + command = function() require("snacks").picker.gh_pr({ state = "all" }) end, + opts = { desc = "GitHub Pull Requests (all)" }, + }, -- lsp keymaps { mode = "n", diff --git a/nvim/lua/core/configs/snacks.lua b/nvim/lua/core/configs/snacks.lua index a8dfb10..f3d65c7 100644 --- a/nvim/lua/core/configs/snacks.lua +++ b/nvim/lua/core/configs/snacks.lua @@ -1,5 +1,6 @@ local picker_config = require("core.configs.snacks_picker") local notifier_config = require("core.configs.snacks_notifier") +local gh_config = require("core.configs.snacks_gh") require("snacks").setup( ---@type snacks.Config @@ -7,6 +8,7 @@ require("snacks").setup( bigfile = { enabled = true }, dashboard = { enabled = false }, explorer = { enabled = false, replace_netrw = false }, + gh = gh_config, image = { enabled = false }, indent = { enabled = true }, input = { enabled = false }, diff --git a/nvim/lua/core/configs/snacks_gh.lua b/nvim/lua/core/configs/snacks_gh.lua new file mode 100644 index 0000000..64bc1c8 --- /dev/null +++ b/nvim/lua/core/configs/snacks_gh.lua @@ -0,0 +1,4 @@ +---@class snacks.gh.Config +return { + enabled = true, +}