diff --git a/lua/astrocommunity/git/octo-nvim/init.lua b/lua/astrocommunity/git/octo-nvim/init.lua index da41ca729..671300c6e 100644 --- a/lua/astrocommunity/git/octo-nvim/init.lua +++ b/lua/astrocommunity/git/octo-nvim/init.lua @@ -1,4 +1,18 @@ local prefix = "O" +local maps = { n = {} } +local icon = vim.g.icons_enabled and " " or "" +maps.n[prefix] = { desc = icon .. "Octo" } +maps.n[prefix .. "c"] = { desc = "Comments" } +maps.n[prefix .. "t"] = { desc = "Threads" } +maps.n[prefix .. "i"] = { desc = "Issues" } +maps.n[prefix .. "p"] = { desc = "Pull requests" } +maps.n[prefix .. "pm"] = { desc = "Merge current PR" } +maps.n[prefix .. "r"] = { desc = "Repo" } +maps.n[prefix .. "a"] = { desc = "Assignee/Reviewer" } +maps.n[prefix .. "l"] = { desc = "Label" } +maps.n[prefix .. "e"] = { desc = "Reaction" } +maps.n[prefix .. "s"] = { desc = "Review" } +require("astronvim.utils").set_mappings(maps) return { "pwntester/octo.nvim", dependencies = { @@ -9,27 +23,22 @@ return { cmd = { "Octo" }, opts = { use_diagnostic_signs = true, + mappings = {}, }, keys = { - { prefix, desc = "Octo" }, - { prefix .. "c", desc = "Comments" }, { prefix .. "ca", "Octo comment add", desc = "Add a new comment" }, { prefix .. "cd", "Octo comment delete", desc = "Delete a comment" }, - { prefix .. "t", desc = "Threads" }, { prefix .. "ta", "Octo thread resolve", desc = "Mark thread as resolved" }, { prefix .. "td", "Octo thread unresolve", desc = "Mark thread as unresolved" }, - { prefix .. "i", desc = "Issues" }, { 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 .. "p", desc = "Pull requests" }, { prefix .. "pp", "Octo pr checkout", desc = "Checkout PR" }, - { prefix .. "pm", desc = "Merge current 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" }, @@ -44,23 +53,19 @@ return { { prefix .. "pt", "Octo pr commits", desc = "List PR commits" }, { prefix .. "pl", "Octo pr commits", desc = "List changed files in PR" }, - { prefix .. "r", desc = "Repo" }, { prefix .. "rl", "Octo repo list", desc = "List repo user stats" }, { prefix .. "rf", "Octo repo fork", desc = "Fork repo" }, { prefix .. "ro", "Octo repo open", desc = "Open current repo in browser" }, { prefix .. "ru", "Octo repo url", desc = "Copies URL of current repo" }, - { prefix .. "a", desc = "Assignee/Reviewer" }, { 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 .. "l", desc = "Label" }, { 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 .. "e", desc = "Reactions" }, { 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" }, @@ -72,7 +77,6 @@ return { { prefix .. "x", "Octo actions", desc = "Run an action" }, - { prefix .. "s", desc = "Review" }, { prefix .. "ss", " Octo review start", desc = "Start review" }, { prefix .. "sf", " Octo review submit", desc = "Submit review" }, { prefix .. "sr", " Octo review resume", desc = "Submit resume" },