summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/extra/octo.lua
blob: f4d177cdbad99ef94314b48ebde56eaa87bdf2b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
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 = "<space>ic", -- close issue
        reopen_issue = "<space>io", -- reopen issue
        list_issues = "<space>il", -- list open issues on same repo
        reload = "<C-r>", -- reload issue
        open_in_browser = "<C-b>", -- open issue in browser
        copy_url = "<C-y>", -- copy url to system clipboard
        add_assignee = "<space>aa", -- add assignee
        remove_assignee = "<space>ad", -- remove assignee
        create_label = "<space>lc", -- create label
        add_label = "<space>la", -- add label
        remove_label = "<space>ld", -- remove label
        goto_issue = "<space>gi", -- navigate to a local repo issue
        add_comment = "<space>ca", -- add comment
        delete_comment = "<space>cd", -- delete comment
        next_comment = "]c", -- go to next comment
        prev_comment = "[c", -- go to previous comment
        react_hooray = "<space>rp", -- add/remove 🎉 reaction
        react_heart = "<space>rh", -- add/remove ❤️ reaction
        react_eyes = "<space>re", -- add/remove 👀 reaction
        react_thumbs_up = "<space>r+", -- add/remove 👍 reaction
        react_thumbs_down = "<space>r-", -- add/remove 👎 reaction
        react_rocket = "<space>rr", -- add/remove 🚀 reaction
        react_laugh = "<space>rl", -- add/remove 😄 reaction
        react_confused = "<space>rc", -- add/remove 😕 reaction
      },
      pull_request = {
        checkout_pr = "<space>po", -- checkout PR
        merge_pr = "<space>pm", -- merge PR
        list_commits = "<space>pc", -- list PR commits
        list_changed_files = "<space>pf", -- list PR changed files
        show_pr_diff = "<space>pd", -- show PR diff
        add_reviewer = "<space>va", -- add reviewer
        remove_reviewer = "<space>vd", -- remove reviewer request
        close_issue = "<space>ic", -- close PR
        reopen_issue = "<space>io", -- reopen PR
        list_issues = "<space>il", -- list open issues on same repo
        reload = "<C-r>", -- reload PR
        open_in_browser = "<C-b>", -- open PR in browser
        copy_url = "<C-y>", -- copy url to system clipboard
        add_assignee = "<space>aa", -- add assignee
        remove_assignee = "<space>ad", -- remove assignee
        create_label = "<space>lc", -- create label
        add_label = "<space>la", -- add label
        remove_label = "<space>ld", -- remove label
        goto_issue = "<space>gi", -- navigate to a local repo issue
        add_comment = "<space>ca", -- add comment
        delete_comment = "<space>cd", -- delete comment
        next_comment = "]c", -- go to next comment
        prev_comment = "[c", -- go to previous comment
        react_hooray = "<space>rp", -- add/remove 🎉 reaction
        react_heart = "<space>rh", -- add/remove ❤️ reaction
        react_eyes = "<space>re", -- add/remove 👀 reaction
        react_thumbs_up = "<space>r+", -- add/remove 👍 reaction
        react_thumbs_down = "<space>r-", -- add/remove 👎 reaction
        react_rocket = "<space>rr", -- add/remove 🚀 reaction
        react_laugh = "<space>rl", -- add/remove 😄 reaction
        react_confused = "<space>rc", -- add/remove 😕 reaction
      },
      review_thread = {
        goto_issue = "<space>gi", -- navigate to a local repo issue
        add_comment = "<space>ca", -- add comment
        add_suggestion = "<space>sa", -- add suggestion
        delete_comment = "<space>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 = "<C-c>", -- close review tab
        react_hooray = "<space>rp", -- add/remove 🎉 reaction
        react_heart = "<space>rh", -- add/remove ❤️ reaction
        react_eyes = "<space>re", -- add/remove 👀 reaction
        react_thumbs_up = "<space>r+", -- add/remove 👍 reaction
        react_thumbs_down = "<space>r-", -- add/remove 👎 reaction
        react_rocket = "<space>rr", -- add/remove 🚀 reaction
        react_laugh = "<space>rl", -- add/remove 😄 reaction
        react_confused = "<space>rc", -- add/remove 😕 reaction
      },
      submit_win = {
        approve_review = "<C-a>", -- approve review
        comment_review = "<C-m>", -- comment review
        request_changes = "<C-r>", -- request changes review
        close_review_tab = "<C-c>", -- close review tab
      },
      review_diff = {
        add_review_comment = "<space>ca", -- add a new review comment
        add_review_suggestion = "<space>sa", -- add a new review suggestion
        focus_files = "<leader>e", -- move focus to changed file panel
        toggle_files = "<leader>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 = "<C-c>", -- close review tab
        toggle_viewed = "<leader><space>", -- toggle viewer viewed state
      },
      file_panel = {
        next_entry = "j", -- move to next changed file
        prev_entry = "k", -- move to previous changed file
        select_entry = "<cr>", -- show selected changed file diffs
        refresh_files = "R", -- refresh changed files panel
        focus_files = "<leader>e", -- move focus to changed file panel
        toggle_files = "<leader>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 = "<C-c>", -- close review tab
        toggle_viewed = "<leader><space>", -- toggle viewer viewed state
      },
    },
  }
end

return M