From 540268d618627079c9b958a955b586e1888b46a8 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 10 Aug 2021 23:15:04 +0200 Subject: Major refactor of nvim --- .config/nvim/lua/extra/octo.lua | 139 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 .config/nvim/lua/extra/octo.lua (limited to '.config/nvim/lua/extra/octo.lua') diff --git a/.config/nvim/lua/extra/octo.lua b/.config/nvim/lua/extra/octo.lua new file mode 100644 index 0000000..5a110df --- /dev/null +++ b/.config/nvim/lua/extra/octo.lua @@ -0,0 +1,139 @@ +local M = {} + +local Log = require "core.log" + +M.config = function() + local status_ok, octo = pcall(require, "octo") + if not status_ok then + Log:get_default().error "Failed to load octo" + return + end + + octo.setup { + default_remote = { "upstream", "origin" }, -- order to try remotes + reaction_viewer_hint_icon = "", -- marker for user reactions + user_icon = " ", -- user icon + timeline_marker = "", -- timeline marker + timeline_indent = "2", -- timeline indentation + right_bubble_delimiter = "", -- Bubble delimiter + left_bubble_delimiter = "", -- Bubble delimiter + github_hostname = "", -- GitHub Enterprise host + snippet_context_lines = 4, -- number or lines around commented lines + file_panel = { + size = 10, -- changed files panel rows + use_icons = true, -- use web-devicons in file panel + }, + mappings = { + issue = { + close_issue = "ic", -- close issue + reopen_issue = "io", -- reopen issue + list_issues = "il", -- list open issues on same repo + reload = "", -- reload issue + open_in_browser = "", -- open issue in browser + copy_url = "", -- copy url to system clipboard + add_assignee = "aa", -- add assignee + remove_assignee = "ad", -- remove assignee + create_label = "lc", -- create label + add_label = "la", -- add label + remove_label = "ld", -- remove label + goto_issue = "gi", -- navigate to a local repo issue + add_comment = "ca", -- add comment + delete_comment = "cd", -- delete comment + next_comment = "]c", -- go to next comment + prev_comment = "[c", -- go to previous comment + react_hooray = "rp", -- add/remove 🎉 reaction + react_heart = "rh", -- add/remove ❤️ reaction + react_eyes = "re", -- add/remove 👀 reaction + react_thumbs_up = "r+", -- add/remove 👍 reaction + react_thumbs_down = "r-", -- add/remove 👎 reaction + react_rocket = "rr", -- add/remove 🚀 reaction + react_laugh = "rl", -- add/remove 😄 reaction + react_confused = "rc", -- add/remove 😕 reaction + }, + pull_request = { + checkout_pr = "po", -- checkout PR + merge_pr = "pm", -- merge PR + list_commits = "pc", -- list PR commits + list_changed_files = "pf", -- list PR changed files + show_pr_diff = "pd", -- show PR diff + add_reviewer = "va", -- add reviewer + remove_reviewer = "vd", -- remove reviewer request + close_issue = "ic", -- close PR + reopen_issue = "io", -- reopen PR + list_issues = "il", -- list open issues on same repo + reload = "", -- reload PR + open_in_browser = "", -- open PR in browser + copy_url = "", -- copy url to system clipboard + add_assignee = "aa", -- add assignee + remove_assignee = "ad", -- remove assignee + create_label = "lc", -- create label + add_label = "la", -- add label + remove_label = "ld", -- remove label + goto_issue = "gi", -- navigate to a local repo issue + add_comment = "ca", -- add comment + delete_comment = "cd", -- delete comment + next_comment = "]c", -- go to next comment + prev_comment = "[c", -- go to previous comment + react_hooray = "rp", -- add/remove 🎉 reaction + react_heart = "rh", -- add/remove ❤️ reaction + react_eyes = "re", -- add/remove 👀 reaction + react_thumbs_up = "r+", -- add/remove 👍 reaction + react_thumbs_down = "r-", -- add/remove 👎 reaction + react_rocket = "rr", -- add/remove 🚀 reaction + react_laugh = "rl", -- add/remove 😄 reaction + react_confused = "rc", -- add/remove 😕 reaction + }, + review_thread = { + goto_issue = "gi", -- navigate to a local repo issue + add_comment = "ca", -- add comment + add_suggestion = "sa", -- add suggestion + delete_comment = "cd", -- delete comment + next_comment = "]c", -- go to next comment + prev_comment = "[c", -- go to previous comment + select_next_entry = "]q", -- move to previous changed file + select_prev_entry = "[q", -- move to next changed file + close_review_tab = "", -- close review tab + react_hooray = "rp", -- add/remove 🎉 reaction + react_heart = "rh", -- add/remove ❤️ reaction + react_eyes = "re", -- add/remove 👀 reaction + react_thumbs_up = "r+", -- add/remove 👍 reaction + react_thumbs_down = "r-", -- add/remove 👎 reaction + react_rocket = "rr", -- add/remove 🚀 reaction + react_laugh = "rl", -- add/remove 😄 reaction + react_confused = "rc", -- add/remove 😕 reaction + }, + submit_win = { + approve_review = "", -- approve review + comment_review = "", -- comment review + request_changes = "", -- request changes review + close_review_tab = "", -- close review tab + }, + review_diff = { + add_review_comment = "ca", -- add a new review comment + add_review_suggestion = "sa", -- add a new review suggestion + focus_files = "e", -- move focus to changed file panel + toggle_files = "b", -- hide/show changed files panel + next_thread = "]t", -- move to next thread + prev_thread = "[t", -- move to previous thread + select_next_entry = "]q", -- move to previous changed file + select_prev_entry = "[q", -- move to next changed file + close_review_tab = "", -- close review tab + toggle_viewed = "", -- toggle viewer viewed state + }, + file_panel = { + next_entry = "j", -- move to next changed file + prev_entry = "k", -- move to previous changed file + select_entry = "", -- show selected changed file diffs + refresh_files = "R", -- refresh changed files panel + focus_files = "e", -- move focus to changed file panel + toggle_files = "b", -- hide/show changed files panel + select_next_entry = "]q", -- move to previous changed file + select_prev_entry = "[q", -- move to next changed file + close_review_tab = "", -- close review tab + toggle_viewed = "", -- toggle viewer viewed state + }, + }, + } +end + +return M -- cgit v1.2.3-70-g09d2