diff --git a/.config/nvim/lua/plugins/github.lua b/.config/nvim/lua/plugins/github.lua new file mode 100644 index 00000000..34c01459 --- /dev/null +++ b/.config/nvim/lua/plugins/github.lua @@ -0,0 +1,102 @@ +local prefix = "G" +local icon = vim.g.icons_enabled and " " or "" +return { + { + "almo7aya/openingh.nvim", + cmd = { "OpenInGHRepo", "OpenInGHFile", "OpenInGHFileLines" }, + keys = { + { prefix .. "ro", "OpenInGHRepo", desc = "Open git repo in web", mode = { "n" } }, + { prefix .. "rf", "OpenInGHFile", desc = "Open git file in web", mode = { "n" } }, + { prefix .. "rf", "OpenInGHFileLines", desc = "Open git lines in web", mode = { "x", "v" } }, + }, + }, + { + "folke/which-key.nvim", + opts = { + defaults = { + ["Gc"] = { name = "+comments" }, + ["Gt"] = { name = "+threads" }, + ["Gi"] = { name = "+issues" }, + ["Gp"] = { name = "+pull requests" }, + ["Gpm"] = { name = "+merge current PR" }, + ["Gr"] = { name = "+repo" }, + ["Ga"] = { name = "+assignee/reviewer" }, + ["Gl"] = { name = "+label" }, + ["Ge"] = { name = "+reaction" }, + ["GR"] = { name = "+review" }, + }, + }, + }, + { + "pwntester/octo.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope.nvim", + "nvim-tree/nvim-web-devicons", + }, + cmd = { "Octo" }, + opts = { + use_diagnostic_signs = true, + mappings = {}, + }, + keys = { + { prefix .. "ca", "Octo comment add", desc = "Add a new comment" }, + { prefix .. "cd", "Octo comment delete", desc = "Delete a comment" }, + + { prefix .. "ta", "Octo thread resolve", desc = "Mark thread as resolved" }, + { prefix .. "td", "Octo thread unresolve", desc = "Mark thread as unresolved" }, + + { prefix .. "ic", "Octo issue close", desc = "Close current issue" }, + { prefix .. "ir", "Octo issue reopen", desc = "Reopen current issue" }, + { prefix .. "il", "Octo issue list", desc = "List open issues" }, + { prefix .. "iu", "Octo issue url", desc = "Copies URL of current issue" }, + { prefix .. "io", "Octo issue browser", desc = "Open current issue in browser" }, + + { prefix .. "pp", "Octo pr checkout", desc = "Checkout PR" }, + { prefix .. "pmm", "Octo pr merge commit", desc = "Merge commit PR" }, + { prefix .. "pms", "Octo pr merge squash", desc = "Squash merge PR" }, + { prefix .. "pmd", "Octo pr merge delete", desc = "Delete merge PR" }, + { prefix .. "pmr", "Octo pr merge rebase", desc = "Rebase merge PR" }, + { prefix .. "pc", "Octo pr close", desc = "Close current PR" }, + { prefix .. "pn", "Octo pr create", desc = "Create PR for current branch" }, + { prefix .. "pd", "Octo pr diff", desc = "Show PR diff" }, + { prefix .. "ps", "Octo pr list", desc = "List open PRs" }, + { prefix .. "pr", "Octo pr ready", desc = "Mark draft as ready for review" }, + { prefix .. "po", "Octo pr browser", desc = "Open current PR in browser" }, + { prefix .. "pu", "Octo pr url", desc = "Copies URL of current PR" }, + { prefix .. "pt", "Octo pr commits", desc = "List PR commits" }, + { prefix .. "pl", "Octo pr commits", desc = "List changed files in PR" }, + + { prefix .. "rl", "Octo repo list", desc = "List repo user stats" }, + { prefix .. "rF", "Octo repo fork", desc = "Fork repo" }, + { prefix .. "ru", "Octo repo url", desc = "Copies URL of current repo" }, + + { prefix .. "aa", " Octo assignee add", desc = "Assign a user" }, + { prefix .. "ar", " Octo assignee remove", desc = "Remove a user" }, + { prefix .. "ap", " Octo reviewer add", desc = "Assign a PR reviewer" }, + + { prefix .. "la", " Octo label add", desc = "Assign a label" }, + { prefix .. "lr", " Octo label remove", desc = "Remove a label" }, + { prefix .. "lc", " Octo label create", desc = "Create a label" }, + + { prefix .. "e1", "Octo reaction thumbs_up", desc = "Add 👍 reaction" }, + { prefix .. "e2", "Octo reaction thumbs_down", desc = "Add 👎 reaction" }, + { prefix .. "e3", "Octo reaction eyes", desc = "Add 👀 reaction" }, + { prefix .. "e4", "Octo reaction laugh", desc = "Add 😄 reaction" }, + { prefix .. "e5", "Octo reaction confused", desc = "Add 😕 reaction" }, + { prefix .. "e6", "Octo reaction rocket", desc = "Add 🚀 reaction" }, + { prefix .. "e7", "Octo reaction heart", desc = "Add ❤️ reaction" }, + { prefix .. "e8", "Octo reaction party", desc = "Add 🎉 reaction" }, + + { prefix .. "x", "Octo actions", desc = "Run an action" }, + + { prefix .. "ss", " Octo review start", desc = "Start review" }, + { prefix .. "sf", " Octo review submit", desc = "Submit review" }, + { prefix .. "sr", " Octo review resume", desc = "Submit resume" }, + { prefix .. "sd", " Octo review discard", desc = "Delete pending review" }, + { prefix .. "sc", " Octo review comments", desc = "View pending comments" }, + { prefix .. "sp", " Octo review commit", desc = "Select commit to review" }, + { prefix .. "sc", " Octo review close", desc = "Return to PR" }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/which-key.lua b/.config/nvim/lua/plugins/which-key.lua index 3a1ee84a..3120fb6f 100644 --- a/.config/nvim/lua/plugins/which-key.lua +++ b/.config/nvim/lua/plugins/which-key.lua @@ -29,16 +29,11 @@ return { ["D"] = { name = "+database" }, ["sS"] = { name = "+Goto Symbols (Workspace)" }, ["ss"] = { name = "+Goto Symbols" }, - ["db"] = { name = "+Breakpoints" }, ["sr"] = { name = "+replace" }, ["dP"] = { name = "+python" }, ["gc"] = { name = "+conflicts" }, + ["G"] = { name = "+github" }, }, }, - config = function(_, opts) - local wk = require("which-key") - wk.setup(opts) - wk.register(opts.defaults) - end, }, }