### Lua Configuration Example for octo.nvim Source: https://github.com/pwntester/octo.nvim/blob/master/doc/octo.txt This snippet shows an example configuration for the octo.nvim plugin written in Lua. It outlines how to set up the plugin, which is essential for its functionality. ```lua -- Example configuration for octo.nvim local octo = require('octo') octo.setup({ -- Add your configuration options here }) ``` -------------------------------- ### Octo.nvim Plugin Installation (Lua) Source: https://github.com/pwntester/octo.nvim/blob/master/README.md This Lua code snippet shows how to install the Octo.nvim plugin using a package manager for Neovim. It specifies the plugin itself and its required dependencies, such as plenary.nvim, telescope.nvim (or alternatives), and nvim-web-devicons. The configuration function sets up Octo.nvim. ```lua use { 'pwntester/octo.nvim', requires = { 'nvim-lua/plenary.nvim', 'nvim-telescope/telescope.nvim', -- OR 'ibhagwan/fzf-lua', -- OR 'folke/snacks.nvim', 'nvim-tree/nvim-web-devicons', }, config = function () require"octo".setup() end } ``` -------------------------------- ### Octo.nvim Usage Examples (Vimscript) Source: https://github.com/pwntester/octo.nvim/blob/master/README.md This snippet demonstrates various commands for interacting with GitHub issues, pull requests, and discussions using the Octo.nvim plugin. It shows how to open specific issues, create new ones, list issues with filters, and search for items. ```vim Octo https://github.com/pwntester/octo.nvim/issues/12 Octo issue create Octo issue create pwntester/octo.nvim Octo comment add Octo reaction add hooray Octo issue edit pwntester/octo.nvim 1 Octo issue edit 1 Octo issue list createdBy=pwntester Octo issue list neovim/neovim labels=bug,help\ wanted states=OPEN Octo search assignee:pwntester is:pr Octo search is:discussion repo:pwntester/octo.nvim category:"Show and Tell" ``` -------------------------------- ### octo.nvim Commands for PR Review Source: https://github.com/pwntester/octo.nvim/blob/master/doc/octo.txt This provides a set of commands for interacting with Pull Requests within octo.nvim. It includes starting and resuming reviews, navigating changes, adding comments, and submitting reviews. ```vim " Open a PR for review Octo " List all PRs Octo pr list " Edit a specific PR Octo pr edit " Start a new review Octo review start " Resume a pending review Octo review resume " Navigate file panel ] q [q " Add a comment (visual select lines first) ca " Add a suggestion (visual select lines first) sa " Review pending comments Octo review comments " Review a specific commit Octo review commit " Submit the review Octo review submit ``` -------------------------------- ### octo.nvim: Issue Management Keybindings Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Keybindings for managing GitHub Issues. This includes closing, reopening, and listing issues. The keybindings often start with a `` prefix followed by 'i' for issue-related actions. ```lua close_issue = { lhs = "ic", desc = "close PR" }, reopen_issue = { lhs = "io", desc = "reopen PR" }, list_issues = { lhs = "il", desc = "list open issues on same repo" } ``` -------------------------------- ### octo.nvim: Review Thread Keybindings Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Keybindings for managing review threads within GitHub PRs. This includes starting and resuming reviews, resolving and unresolving threads, and navigating through review entries. Some navigation keys are standard Vim motions. ```lua review_start = { lhs = "vs", desc = "start a review for the current PR" }, review_resume = { lhs = "vr", desc = "resume a pending review for the current PR" }, resolve_thread = { lhs = "rt", desc = "resolve PR thread" }, unresolve_thread = { lhs = "rT", desc = "unresolve PR thread" } ``` -------------------------------- ### Configure octo.nvim Plugin Settings Source: https://github.com/pwntester/octo.nvim/blob/master/README.md This Lua code snippet demonstrates how to configure the octo.nvim plugin. It allows customization of various settings such as file system usage, built-in actions, default remotes, merge methods, branch deletion policies, SSH aliases, picker integration, and UI elements. The configuration is passed as a table to the `require'octo'.setup()` function. ```lua require("octo").setup({ use_local_fs = false, -- use local files on right side of reviews enable_builtin = false, -- shows a list of builtin actions when no action is provided default_remote = {"upstream", "origin"}, -- order to try remotes default_merge_method = "commit", -- default merge method which should be used for both `Octo pr merge` and merging from picker, could be `commit`, `rebase` or `squash` default_delete_branch = false, -- whether to delete branch when merging pull request with either `Octo pr merge` or from picker (can be overridden with `delete`/`nodelete` argument to `Octo pr merge`) ssh_aliases = {}, -- SSH aliases. e.g. `ssh_aliases = {["github.com-work"] = "github.com"}`. The key part will be interpreted as an anchored Lua pattern. picker = "telescope", -- or "fzf-lua" or "snacks" picker_config = { use_emojis = false, -- only used by "fzf-lua" picker for now mappings = { -- mappings for the pickers open_in_browser = { lhs = "", desc = "open issue in browser" }, copy_url = { lhs = "", desc = "copy url to system clipboard" }, copy_sha = { lhs = "", desc = "copy commit SHA to system clipboard" }, checkout_pr = { lhs = "", desc = "checkout pull request" }, merge_pr = { lhs = "", desc = "merge pull request" }, }, snacks = { -- snacks specific config actions = { -- custom actions for specific snacks pickers (array of tables) issues = { -- actions for the issues picker -- { name = "my_issue_action", fn = function(picker, item) print("Issue action:", vim.inspect(item)) end, lhs = "a", desc = "My custom issue action" }, }, pull_requests = { -- actions for the pull requests picker -- { name = "my_pr_action", fn = function(picker, item) print("PR action:", vim.inspect(item)) end, lhs = "b", desc = "My custom PR action" }, }, notifications = {}, -- actions for the notifications picker issue_templates = {}, -- actions for the issue templates picker search = {}, -- actions for the search picker -- ... add actions for other pickers as needed }, }, }, comment_icon = "▎", -- comment marker outdated_icon = "󰅒 ", -- outdated indicator resolved_icon = " ", -- resolved indicator reaction_viewer_hint_icon = " ", -- marker for user reactions commands = {}, -- additional subcommands made available to `Octo` command users = "search", -- Users for assignees or reviewers. Values: "search" | "mentionable" | "assignable" user_icon = " ", -- user icon ghost_icon = "󰊠 ", -- ghost icon timeline_marker = " ", -- timeline marker timeline_indent = 2, -- timeline indentation use_timeline_icons = true, -- toggle timeline icons timeline_icons = { commit = " ", label = " ", reference = " ", connected = " ", subissue = " ", cross_reference = " ", parent_issue = " ", pinned = " ", milestone = " ", renamed = " ", merged = { " ", "OctoPurple" }, closed = { closed = { " ", "OctoRed" }, completed = { " ", "OctoPurple" }, not_planned = { " ", "OctoGrey" }, duplicate = { " ", "OctoGrey" }, }, reopened = { " ", "OctoGreen" }, assigned = " ", review_requested = " ", }, 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 gh_cmd = "gh", -- Command to use when calling Github CLI gh_env = {}, -- extra environment variables to pass on to GitHub CLI, can be a table or function returning a table timeout = 5000, -- timeout for requests between the remote server default_to_projects_v2 = false, -- use projects v2 for the `Octo card ...` command by default. Both legacy and v2 commands are available under `Octo cardlegacy ...` and `Octo cardv2 ...` respectively. ui = { use_signcolumn = false, -- show "modified" marks on the sign column use_signstatus = true, -- show "modified" marks on the status column }, issues = { }} ``` -------------------------------- ### octo.nvim: Review Navigation and Actions Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Keybindings specifically for navigating and interacting within the review interface of octo.nvim. This includes moving between changed files, selecting the first/last entry, closing the review tab, and adding suggestions. ```lua add_suggestion = { lhs = "sa", desc = "add suggestion" }, select_next_entry = { lhs = "]q", desc = "move to next changed file" }, select_prev_entry = { lhs = "[q", desc = "move to previous changed file" }, select_first_entry = { lhs = "[Q", desc = "move to first changed file" }, select_last_entry = { lhs = "]Q", desc = "move to last changed file" }, close_review_tab = { lhs = "", desc = "close review tab" } ``` -------------------------------- ### octo.nvim: PR Actions Keybindings Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Keybindings for performing actions on GitHub Pull Requests. These include rebasing, merging, listing commits and files, showing diffs, and opening PRs in a browser. Usage typically involves a `` prefix followed by specific command keys. ```lua rebase_and_merge_pr = { lhs = "prm", desc = "rebase and merge PR" }, merge_pr_queue = { lhs = "pq", desc = "merge commit PR and add to merge queue (Merge queue must be enabled in the repo)" }, squash_and_merge_queue = { lhs = "psq", desc = "squash and add to merge queue (Merge queue must be enabled in the repo)" }, rebase_and_merge_queue = { lhs = "prq", desc = "rebase and add to merge queue (Merge queue must be enabled in the repo)" }, list_commits = { lhs = "pc", desc = "list PR commits" }, list_changed_files = { lhs = "pf", desc = "list PR changed files" }, show_pr_diff = { lhs = "pd", desc = "show PR diff" }, reload = { lhs = "", desc = "reload PR" }, open_in_browser = { lhs = "", desc = "open PR in browser" }, copy_url = { lhs = "", desc = "copy url to system clipboard" } ``` -------------------------------- ### Authenticate with GitHub CLI Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Command to re-authenticate the GitHub CLI with the necessary 'read:project' scope or to log in if not already authenticated. It prompts for authorization and ensures credentials are saved. ```bash gh auth refresh -s read:project ``` ```bash GITHUB_TOKEN= gh auth login ``` -------------------------------- ### octo.nvim: Comment and Reply Keybindings Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Keybindings for interacting with comments on GitHub PRs and Issues. This includes adding comments, replies, and deleting comments, as well as navigating between comments. Keybindings typically use a `` prefix and 'c' for comment actions. ```lua add_comment = { lhs = "ca", desc = "add comment" }, add_reply = { lhs = "cr", desc = "add reply" }, delete_comment = { lhs = "cd", desc = "delete comment" }, next_comment = { lhs = "]c", desc = "go to next comment" }, prev_comment = { lhs = "[c", desc = "go to previous comment" } ``` -------------------------------- ### Configure GitHub File Panel Navigation in octo.nvim Source: https://github.com/pwntester/octo.nvim/blob/master/README.md This snippet configures keybindings for navigating and interacting with the file panel in octo.nvim. It includes actions for submitting, discarding, and commenting on reviews, as well as focusing and toggling the file panel, and selecting changed files. Keybindings are defined for various modes. ```lua file_panel = { submit_review = { lhs = "vs", desc = "submit review" }, discard_review = { lhs = "vd", desc = "discard review" }, next_entry = { lhs = "j", desc = "move to next changed file" }, prev_entry = { lhs = "k", desc = "move to previous changed file" }, select_entry = { lhs = "", desc = "show selected changed file diffs" }, refresh_files = { lhs = "R", desc = "refresh changed files panel" }, focus_files = { lhs = "e", desc = "move focus to changed file panel" }, toggle_files = { lhs = "b", desc = "hide/show changed files panel" }, select_next_entry = { lhs = "]q", desc = "move to next changed file" }, select_prev_entry = { lhs = "[q", desc = "move to previous changed file" }, select_first_entry = { lhs = "[Q", desc = "move to first changed file" }, select_last_entry = { lhs = "]Q", desc = "move to last changed file" }, close_review_tab = { lhs = "", desc = "close review tab" }, toggle_viewed = { lhs = "", desc = "toggle viewer viewed state" }, } ``` -------------------------------- ### octo.nvim: Label Management Keybindings Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Keybindings for managing labels on GitHub Issues and PRs. This includes creating, adding, and removing labels. These actions are accessed via a `` prefix followed by 'l' for label operations. ```lua create_label = { lhs = "lc", desc = "create label" }, add_label = { lhs = "la", desc = "add label" }, remove_label = { lhs = "ld", desc = "remove label" } ``` -------------------------------- ### Search Pull Requests by Author and Repository Source: https://github.com/pwntester/octo.nvim/blob/master/doc/octo.txt Vim command to search for pull requests using the Octo.nvim plugin. It demonstrates searching by author and specifying the repository. ```vim :Octo search is:pr author:pwntester repo:github/codeql ``` -------------------------------- ### octo.nvim: Navigation Keybindings Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Keybindings for navigating within the octo.nvim interface and related code. This includes navigating to files and local repository issues. The 'gf' keybinding is a standard Vim command for opening files. ```lua goto_file = { lhs = "gf", desc = "go to file" }, goto_issue = { lhs = "gi", desc = "navigate to a local repo issue" } ``` -------------------------------- ### Octo Discussion Commands Source: https://github.com/pwntester/octo.nvim/blob/master/doc/octo.txt Commands for managing GitHub discussions. Includes actions to list, create, reload, close, reopen, mark/unmark comments as answered, and search discussions. Also supports opening discussions in a browser and copying URLs. ```vimscript :Octo discussion list [repo] :Octo discussion browser :Octo discussion create [repo] :Octo discussion reload :Octo discussion close :Octo discussion mark :Octo discussion unmark :Octo discussion reopen :Octo discussion search ``` -------------------------------- ### Configure GitHub Review Diff Navigation in octo.nvim Source: https://github.com/pwntester/octo.nvim/blob/master/README.md This snippet configures keybindings for navigating and interacting with review diffs in octo.nvim. It includes actions for submitting, discarding, and commenting on reviews, as well as focusing and toggling the file panel, navigating between threads and changed files. Keybindings are defined for various modes. ```lua review_diff = { submit_review = { lhs = "vs", desc = "submit review" }, discard_review = { lhs = "vd", desc = "discard review" }, add_review_comment = { lhs = "ca", desc = "add a new review comment", mode = { "n", "x" } }, add_review_suggestion = { lhs = "sa", desc = "add a new review suggestion", mode = { "n", "x" } }, focus_files = { lhs = "e", desc = "move focus to changed file panel" }, toggle_files = { lhs = "b", desc = "hide/show changed files panel" }, next_thread = { lhs = "]t", desc = "move to next thread" }, prev_thread = { lhs = "[t", desc = "move to previous thread" }, select_next_entry = { lhs = "]q", desc = "move to next changed file" }, select_prev_entry = { lhs = "[q", desc = "move to previous changed file" }, select_first_entry = { lhs = "[Q", desc = "move to first changed file" }, select_last_entry = { lhs = "]Q", desc = "move to last changed file" }, close_review_tab = { lhs = "", desc = "close review tab" }, toggle_viewed = { lhs = "", desc = "toggle viewer viewed state" }, goto_file = { lhs = "gf", desc = "go to file" }, } ``` -------------------------------- ### octo.nvim: PR Reviewer and Assignee Keybindings Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Keybindings for managing reviewers and assignees on GitHub Pull Requests. These actions allow adding or removing reviewers and assignees. They typically use a `` prefix followed by 'v' for review actions and 'a' for assignee actions. ```lua add_reviewer = { lhs = "va", desc = "add reviewer" }, remove_reviewer = { lhs = "vd", desc = "remove reviewer request" }, add_assignee = { lhs = "aa", desc = "add assignee" }, remove_assignee = { lhs = "ad", desc = "remove assignee" } ``` -------------------------------- ### Octo Issue Commands Source: https://github.com/pwntester/octo.nvim/blob/master/doc/octo.txt Commands for managing GitHub issues, including closing, reopening, creating, editing, listing, and searching issues. Supports various filters and actions like opening in a browser or copying URLs. ```vimscript :Octo issue close :Octo issue reopen :Octo issue create {repo} :Octo issue edit [number] {repo} :Octo issue list [repo] {key=val} :Octo issue search :Octo issue reload :Octo issue browser :Octo issue url :Octo issue pin :Octo issue unpin ``` -------------------------------- ### Configure GitHub Notification Actions in octo.nvim Source: https://github.com/pwntester/octo.nvim/blob/master/README.md This snippet configures keybindings for managing GitHub notifications within octo.nvim. It provides shortcuts for marking notifications as read or done, and for unsubscribing from notifications. These actions are designed to streamline notification management within the Neovim environment. ```lua notification = { read = { lhs = "nr", desc = "mark notification as read" }, done = { lhs = "nd", desc = "mark notification as done" }, unsubscribe = { lhs = "nu", desc = "unsubscribe from notifications" }, } ``` -------------------------------- ### Configure GitHub Review Actions in octo.nvim Source: https://github.com/pwntester/octo.nvim/blob/master/README.md This snippet configures keybindings for various GitHub review actions within octo.nvim. It defines shortcuts for approving, commenting on, and requesting changes for reviews, as well as closing review tabs. These keybindings are applicable in normal and insert modes. ```lua submit_win = { approve_review = { lhs = "", desc = "approve review", mode = { "n", "i" } }, comment_review = { lhs = "", desc = "comment review", mode = { "n", "i" } }, request_changes = { lhs = "", desc = "request changes review", mode = { "n", "i" } }, close_review_tab = { lhs = "", desc = "close review tab", mode = { "n", "i" } }, } ``` -------------------------------- ### Octo Command Usage Source: https://github.com/pwntester/octo.nvim/blob/master/doc/octo.txt The primary command for interacting with GitHub objects. It can accept an object and action, or a URL from which to extract repository and object information. Mappings can be configured for commands. ```vimscript Octo [args] ``` -------------------------------- ### octo.nvim Completion Integration with nvim-cmp Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Integration of octo.nvim's completion capabilities with the nvim-cmp plugin. This allows for autocompletion of issues, PRs, commits, users, and emojis directly within Neovim buffers. ```vimscript use cmp-git use blink-cmp-git use cmp-emoji use blink-emoji.nvim ``` -------------------------------- ### octo.nvim: Reaction Keybindings Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Keybindings for adding and removing emoji reactions to comments and PRs. A variety of common emojis are supported, accessed via a `` prefix followed by 'r' and a reaction-specific key. ```lua react_hooray = { lhs = "rp", desc = "add/remove 🎉 reaction" }, react_heart = { lhs = "rh", desc = "add/remove ❤️ reaction" }, react_eyes = { lhs = "re", desc = "add/remove 👀 reaction" }, react_thumbs_up = { lhs = "r+", desc = "add/remove 👍 reaction" }, react_thumbs_down = { lhs = "r-", desc = "add/remove 👎 reaction" }, react_rocket = { lhs = "rr", desc = "add/remove 🚀 reaction" }, react_laugh = { lhs = "rl", desc = "add/remove 😄 reaction" }, react_confused = { lhs = "rc", desc = "add/remove 😕 reaction" } ``` -------------------------------- ### Octo Pull Request (PR) Commands Source: https://github.com/pwntester/octo.nvim/blob/master/doc/octo.txt Commands for managing GitHub pull requests. This includes listing, searching, editing, creating, closing, reopening, checking out, merging, and viewing PR details like commits and diffs. It also supports draft PR actions and checking workflow statuses. ```vimscript :Octo pr list [repo] {key=val} :Octo pr search :Octo pr edit [number] {repo} :Octo pr reopen :Octo pr create :Octo pr close :Octo pr checkout :Octo pr commits :Octo pr changes :Octo pr diff :Octo pr merge [strategy] :Octo pr ready :Octo pr draft :Octo pr checks :Octo pr reload :Octo pr browser :Octo pr url :Octo pr sha :Octo pr runs ``` -------------------------------- ### PR Review Commands in octo.nvim Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Commands for entering review mode, navigating changed files, adding comments, and submitting reviews for GitHub Pull Requests within Neovim. Supports single-line and multi-line comments, thread replies, and review submission with approval or change requests. ```vimscript Octo review Octo Octo pr list Octo pr edit ]q [q ca sa Octo review comments Octo review commit Octo review submit ``` -------------------------------- ### Register Treesitter Markdown Parser for Octo Buffers Source: https://github.com/pwntester/octo.nvim/blob/master/doc/octo.txt Configuration snippet to register the Treesitter markdown parser for buffers with the 'octo' filetype. This enables syntax highlighting for markdown content within Octo.nvim. ```lua vim.treesitter.language.register('markdown', 'octo') ``` -------------------------------- ### Configure SSH Aliases for octo.nvim Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Lua configuration for octo.nvim to map SSH aliases used in repository configurations to 'github.com'. This ensures proper authentication when using SSH aliases. ```lua require('octo').setup({ ssh_aliases = {"[""] = "github.com"} }) ``` -------------------------------- ### Configure Pull Request Options Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Provides options for managing pull requests. 'always_select_remote_on_create' prompts for remote repository selection when creating PRs, while 'use_branch_name_as_title' automatically sets the branch name as the PR title. ```lua pull_requests = { order_by = { field = "CREATED_AT", direction = "DESC" }, always_select_remote_on_create = false, -- always give prompt to select base remote repo when creating PRs use_branch_name_as_title = false -- sets branch name to be the name for the PR } ``` -------------------------------- ### Authenticate gh CLI with GitHub Token Source: https://github.com/pwntester/octo.nvim/blob/master/doc/octo.txt Command to authenticate the GitHub CLI with a personal access token. This is necessary for Octo.nvim to interact with GitHub repositories. ```bash GITHUB_TOKEN= gh auth login ``` -------------------------------- ### Configure Default Key Mappings Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Defines custom keybindings for various actions within octo.nvim. Users can disable default mappings and define their own for enhanced workflow efficiency. ```lua mappings_disable_default = false, -- disable default mappings if true, but will still adapt user mappings mappings = { runs = { expand_step = { lhs = "o", desc = "expand workflow step" }, open_in_browser = { lhs = "", desc = "open workflow run in browser" }, refresh = { lhs = "", desc = "refresh workflow" }, rerun = { lhs = "", desc = "rerun workflow" }, rerun_failed = { lhs = "", desc = "rerun failed workflow" }, cancel = { lhs = "", desc = "cancel workflow" }, copy_url = { lhs = "", desc = "copy url to system clipboard" }, }, issue = { close_issue = { lhs = "ic", desc = "close issue" }, reopen_issue = { lhs = "io", desc = "reopen issue" }, list_issues = { lhs = "il", desc = "list open issues on same repo" }, reload = { lhs = "", desc = "reload issue" }, open_in_browser = { lhs = "", desc = "open issue in browser" }, copy_url = { lhs = "", desc = "copy url to system clipboard" }, add_assignee = { lhs = "aa", desc = "add assignee" }, remove_assignee = { lhs = "ad", desc = "remove assignee" }, create_label = { lhs = "lc", desc = "create label" }, add_label = { lhs = "la", desc = "add label" }, remove_label = { lhs = "ld", desc = "remove label" }, goto_issue = { lhs = "gi", desc = "navigate to a local repo issue" }, add_comment = { lhs = "ca", desc = "add comment" }, add_reply = { lhs = "cr", desc = "add reply" }, delete_comment = { lhs = "cd", desc = "delete comment" }, next_comment = { lhs = "]c", desc = "go to next comment" }, prev_comment = { lhs = "[c", desc = "go to previous comment" }, react_hooray = { lhs = "rp", desc = "add/remove 🎉 reaction" }, react_heart = { lhs = "rh", desc = "add/remove ❤️ reaction" }, react_eyes = { lhs = "re", desc = "add/remove 👀 reaction" }, react_thumbs_up = { lhs = "r+", desc = "add/remove 👍 reaction" }, react_thumbs_down = { lhs = "r-", desc = "add/remove 👎 reaction" }, react_rocket = { lhs = "rr", desc = "add/remove 🚀 reaction" }, react_laugh = { lhs = "rl", desc = "add/remove 😄 reaction" }, react_confused = { lhs = "rc", desc = "add/remove 😕 reaction" }, }, pull_request = { checkout_pr = { lhs = "po", desc = "checkout PR" }, merge_pr = { lhs = "pm", desc = "merge commit PR" }, squash_and_merge_pr = { lhs = "psm", desc = "squash and merge PR" }, } } ``` -------------------------------- ### Enable Autocompletion for Issues and Users Source: https://github.com/pwntester/octo.nvim/blob/master/doc/octo.txt Vim keymap settings to enable autocompletion for issue numbers ('#') and user mentions ('@') within Octo.nvim buffers. It uses the default omnifunc for completion. ```lua vim.keymap.set("i", "@", "@", { silent = true, buffer = true }) vim.keymap.set("i", "#", "#", { silent = true, buffer = true }) ``` -------------------------------- ### Refresh gh Token Scope for Project Access Source: https://github.com/pwntester/octo.nvim/blob/master/doc/octo.txt Command to refresh the GitHub CLI token's scope to include 'read:project'. This is required to view v2 projects in Octo.nvim. ```bash gh auth refresh -s read:project ``` -------------------------------- ### Customize Run Status Icons Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Defines custom icons to represent the status of GitHub Actions runs. This allows for visual differentiation of 'pending', 'in_progress', 'failed', 'succeeded', 'skipped', and 'cancelled' states within the Neovim interface. ```lua icons = { pending = "🕖", in_progress = "🔄", failed = "❌", succeeded = "", skipped = "⏩", cancelled = "✖", } ``` -------------------------------- ### Configure Unresolve PR Thread in octo.nvim Source: https://github.com/pwntester/octo.nvim/blob/master/README.md This snippet configures the keybinding for unresolving a pull request thread in octo.nvim. It defines a specific key sequence for this action, allowing developers to quickly manage the state of PR conversations within Neovim. ```lua unresolve_thread = { lhs = "rT", desc = "unresolve PR thread" } ``` -------------------------------- ### Manage Labels in GitHub via Neovim Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Provides functionality to add, remove, create, delete, and edit labels for a GitHub repository. These commands allow for efficient label management directly within Neovim, interacting with the GitHub API. ```vimscript call octo#label#add('your_label_name') call octo#label#remove('your_label_name') call octo#label#create('your_label_name', 'label description') call octo#label#delete('your_label_name') call octo#label#edit('old_label_name', 'new_label_name', 'new_description') ``` -------------------------------- ### Manage Milestones in GitHub via Neovim Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Allows for adding, removing, creating, and listing milestones for issues and pull requests. This feature facilitates project planning and tracking by associating work items with specific milestones. ```vimscript call octo#milestone#add('milestone_name') call octo#milestone#remove() call octo#milestone#create('milestone_name', 'milestone description') call octo#milestone#list('repository_name') ``` -------------------------------- ### octo.nvim Completion Triggers Source: https://github.com/pwntester/octo.nvim/blob/master/doc/octo.txt This section details how to trigger autocompletion for issues, PRs, and users within octo.nvim. It covers built-in omnifunc completion and integration with nvim-cmp and blink.cmp plugins. ```vim " Built-in omnifunc completion " Using nvim-cmp or blink.cmp with cmp-git or blink-cmp-git " (Configuration specific to the completion plugin) " Using cmp-emoji or blink-emoji.nvim for emoji completion " (Configuration specific to the completion plugin) ``` -------------------------------- ### Manage Assignees in GitHub via Neovim Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Commands to assign or unassign users to an issue or pull request. This helps in distributing work and tracking responsibilities within a team. ```vimscript call octo#assignee#add('username') call octo#assignee#remove('username') ``` -------------------------------- ### Suppress Missing Scope Warning for Projects V2 Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Configuration to suppress the 'read:project' scope warning for GitHub Projects v2. This involves setting a specific option in the user's configuration. ```lua { suppress_missing_scope = { projects_v2 = true, } } ``` -------------------------------- ### Define UI Color Scheme Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Specifies hex color codes for various UI elements and highlight groups within octo.nvim. These colors can be customized to match user preferences or integrate with existing Neovim color schemes. ```lua colors = { white = "#ffffff", grey = "#2A354C", black = "#000000", red = "#fdb8c0", dark_red = "#da3633", green = "#acf2bd", dark_green = "#238636", yellow = "#d3c846", dark_yellow = "#735c0f", blue = "#58A6FF", dark_blue = "#0366d6", purple = "#6f42c1", } ``` -------------------------------- ### Manage Reviewers in GitHub via Neovim Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Assigns users as reviewers for a pull request. This is crucial for the code review process, ensuring that changes are vetted by appropriate team members. ```vimscript call octo#reviewer#add('username') ``` -------------------------------- ### Add Reactions to GitHub Comments via Neovim Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Enables adding common emoji reactions (like thumbs up, thumbs down, eyes, laugh, heart, etc.) to comments on issues and pull requests. This provides a quick way to express sentiment or acknowledge messages. ```vimscript call octo#reaction#add('thumbs_up') call octo#reaction#add('thumbs_down') call octo#reaction#add('eyes') call octo#reaction#add('laugh') call octo#reaction#add('confused') call octo#reaction#add('rocket') call octo#reaction#add('heart') call octo#reaction#add('hooray') ``` -------------------------------- ### Suppress Missing Scope Warning for Projects V2 Source: https://github.com/pwntester/octo.nvim/blob/master/doc/octo.txt Octo.nvim configuration option to suppress warnings related to missing scopes for Projects V2. This is useful if you do not intend to interact with Projects V2. ```lua suppress_missing_scope.projects_v2 = true ``` -------------------------------- ### Configure Issue and Pull Request Sorting Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Sets the criteria for sorting lists of issues and pull requests. Supported fields include 'COMMENTS', 'CREATED_AT', and 'UPDATED_AT'. The direction can be set to 'DESC' (descending) or 'ASC' (ascending). ```lua order_by = { field = "CREATED_AT", -- either COMMENTS, CREATED_AT or UPDATED_AT (https://docs.github.com/en/graphql/reference/enums#issueorderfield) direction = "DESC" -- either DESC or ASC (https://docs.github.com/en/graphql/reference/enums#orderdirection) } ... ``` -------------------------------- ### Octo Parent Command Source: https://github.com/pwntester/octo.nvim/blob/master/doc/octo.txt A command to manage parent relationships for issues. Currently supports adding a parent to the current issue. ```vimscript :Octo parent add ``` -------------------------------- ### Manage Issue Types in GitHub via Neovim Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Commands to add or remove issue types from a GitHub issue. This functionality helps categorize and organize issues within a repository. ```vimscript call octo#type#add('your_issue_type') call octo#type#remove('your_issue_type') ``` -------------------------------- ### Manage Review Threads in GitHub via Neovim Source: https://github.com/pwntester/octo.nvim/blob/master/README.md Commands to mark review threads as resolved or unresolved. These actions interact with the GitHub API to update the status of a review thread associated with a pull request. ```vimscript call octo#thread#resolve() call octo#thread#unresolve() ``` -------------------------------- ### Disable Default Key Mappings in Octo.nvim Source: https://github.com/pwntester/octo.nvim/blob/master/doc/octo.txt Octo.nvim configuration option to disable the default key mappings. This allows users to define their own custom key mappings. ```lua mappings_disable_default = true ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.