Skip to content

Commit

Permalink
feat(git): Add octo (#138)
Browse files Browse the repository at this point in the history
* feat: add octo

* (fix) added mappings

* fix: review keybinding

* fix: Shorter desc and modified prefix

* fix: keybinding

* fix: linting

* fix: remove trailing whitespaces
  • Loading branch information
0xricksanchez authored Apr 26, 2023
1 parent bceb4c4 commit f60b33f
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/astrocommunity/git/octo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Octo

**Repository:** <https://github.com/pwntester/octo.nvim>

Edit and review GitHub issues and pull requests from the comfort of your favorite editor.
85 changes: 85 additions & 0 deletions lua/astrocommunity/git/octo/octo.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
local prefix = "<leader>G"
return {
"pwntester/octo.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
"nvim-tree/nvim-web-devicons",
},
cmd = { "Octo" },
config = function() require("octo").setup() end,
opts = {
use_diagnostic_signs = true,
},
keys = {
{ prefix, desc = "Octo" },
{ prefix .. "c", desc = "Comments" },
{ prefix .. "ca", "<cmd>Octo comment add<CR>", desc = "Add a new comment" },
{ prefix .. "cd", "<cmd>Octo comment delete<CR>", desc = "Delete a comment" },

{ prefix .. "t", desc = "Threads" },
{ prefix .. "ta", "<cmd>Octo thread resolve<CR>", desc = "Mark thread as resolved" },
{ prefix .. "td", "<cmd>Octo thread unresolve<CR>", desc = "Mark thread as unresolved" },

{ prefix .. "i", desc = "Issues" },
{ prefix .. "ic", "<cmd>Octo issue close<CR>", desc = "Close current issue" },
{ prefix .. "ir", "<cmd>Octo issue reopen<CR>", desc = "Reopen current issue" },
{ prefix .. "il", "<cmd>Octo issue list<CR>", desc = "List open issues" },
{ prefix .. "iu", "<cmd>Octo issue url<CR>", desc = "Copies URL of current issue" },
{ prefix .. "io", "<cmd>Octo issue browser<CR>", desc = "Open current issue in browser" },

{ prefix .. "p", desc = "Pull requests" },
{ prefix .. "pp", "<cmd>Octo pr checkout<CR>", desc = "Checkout PR" },
{ prefix .. "pm", desc = "Merge current PR" },
{ prefix .. "pmm", "<cmd>Octo pr merge commit<CR>", desc = "Merge commit PR" },
{ prefix .. "pms", "<cmd>Octo pr merge squash<CR>", desc = "Squash merge PR" },
{ prefix .. "pmd", "<cmd>Octo pr merge delete<CR>", desc = "Delete merge PR" },
{ prefix .. "pmr", "<cmd>Octo pr merge rebase<CR>", desc = "Rebase merge PR" },
{ prefix .. "pc", "<cmd>Octo pr close<CR>", desc = "Close current PR" },
{ prefix .. "pn", "<cmd>Octo pr create<CR>", desc = "Create PR for current branch" },
{ prefix .. "pd", "<cmd>Octo pr diff<CR>", desc = "Show PR diff" },
{ prefix .. "ps", "<cmd>Octo pr list<CR>", desc = "List open PRs" },
{ prefix .. "pr", "<cmd>Octo pr ready<CR>", desc = "Mark draft as ready for review" },
{ prefix .. "po", "<cmd>Octo pr browser<CR>", desc = "Open current PR in browser" },
{ prefix .. "pu", "<cmd>Octo pr url<CR>", desc = "Copies URL of current PR" },
{ prefix .. "pt", "<cmd>Octo pr commits<CR>", desc = "List PR commits" },
{ prefix .. "pl", "<cmd>Octo pr commits<CR>", desc = "List changed files in PR" },

{ prefix .. "r", desc = "Repo" },
{ prefix .. "rl", "<cmd>Octo repo list<CR>", desc = "List repo user stats" },
{ prefix .. "rf", "<cmd>Octo repo fork<CR>", desc = "Fork repo" },
{ prefix .. "ro", "<cmd>Octo repo open<CR>", desc = "Open current repo in browser" },
{ prefix .. "ru", "<cmd>Octo repo url<CR>", desc = "Copies URL of current repo" },

{ prefix .. "a", desc = "Assignee/Reviewer" },
{ prefix .. "aa", "<cmd> Octo assignee add<CR>", desc = "Assign a user" },
{ prefix .. "ar", "<cmd> Octo assignee remove<CR>", desc = "Remove a user" },
{ prefix .. "ap", "<cmd> Octo reviewer add<CR>", desc = "Assign a PR reviewer" },

{ prefix .. "l", desc = "Label" },
{ prefix .. "la", "<cmd> Octo label add<CR>", desc = "Assign a label" },
{ prefix .. "lr", "<cmd> Octo label remove<CR>", desc = "Remove a label" },
{ prefix .. "lc", "<cmd> Octo label create<CR>", desc = "Create a label" },

{ prefix .. "e", desc = "Reactions" },
{ prefix .. "e1", "<cmd>Octo reaction thumbs_up<CR>", desc = "Add 👍 reaction" },
{ prefix .. "e2", "<cmd>Octo reaction thumbs_down<CR>", desc = "Add 👎 reaction" },
{ prefix .. "e3", "<cmd>Octo reaction eyes<CR>", desc = "Add 👀 reaction" },
{ prefix .. "e4", "<cmd>Octo reaction laugh<CR>", desc = "Add 😄 reaction" },
{ prefix .. "e5", "<cmd>Octo reaction confused<CR>", desc = "Add 😕 reaction" },
{ prefix .. "e6", "<cmd>Octo reaction rocket<CR>", desc = "Add 🚀 reaction" },
{ prefix .. "e7", "<cmd>Octo reaction heart<CR>", desc = "Add ❤️ reaction" },
{ prefix .. "e8", "<cmd>Octo reaction party<CR>", desc = "Add 🎉 reaction" },

{ prefix .. "x", "<cmd>Octo actions<CR>", desc = "Run an action" },

{ prefix .. "s", desc = "Review" },
{ prefix .. "ss", "<cmd> Octo review start<CR>", desc = "Start review" },
{ prefix .. "sf", "<cmd> Octo review submit<CR>", desc = "Submit review" },
{ prefix .. "sr", "<cmd> Octo review resume<CR>", desc = "Submit resume" },
{ prefix .. "sd", "<cmd> Octo review discard<CR>", desc = "Delete pending review" },
{ prefix .. "sc", "<cmd> Octo review comments<CR>", desc = "View pending comments" },
{ prefix .. "sp", "<cmd> Octo review commit<CR>", desc = "Select commit to review" },
{ prefix .. "sc", "<cmd> Octo review close<CR>", desc = "Return to PR" },
},
}

0 comments on commit f60b33f

Please sign in to comment.