This Neovim plugin makes jumping from coding to GitHub as painless as possible.
The plugin primarily acts as a wrapper for the GitHub CLI (gh), and also makes a few direct git calls. So ensure the gh tool is installed and can connect to your GitHub account.
Here are instructions for macOS users:
- Install
ghand connect it to your GitHub account.
brew install gh
gh auth login- If
ghis already installed, check it's working with:
gh auth statusInstall gh-navigator via your preferred plugin manager. The following example uses lazy.nvim.
{
'wassimk/gh-navigator.nvim',
version = "*",
config = true
}Important
This plugin is actively developed on the main branch. I recommend using versioned releases with the version key to avoid unexpected breaking changes.
GH is the main command, but it accepts different sub-commands:
Move the cursor over a commit SHA, PR number, or search term and run the GH command to open it on GitHub. The term under the cursor will be used as the argument.
| Sub-Command | Description |
|---|---|
GH blame |
Opens the current file in GitHub's blame view. |
GH browse |
Opens the current file in GitHub's blob view. |
GH pr <arg> |
Opens a PR based on a commit SHA, PR number, or search term (e.g., GH pr 1234, GH pr c2d25b3, or GH pr refactor the actor class). |
GH repo <path> |
Opens a certain path in the current repo on GitHub (e.g., GH repo issues opens the repo's issues page). Auto-completion is available for paths such as issues, pulls, actions, releases, etc. |
Note
Both GH browse and GH blame can accept a range. For instance, in visual mode (V), select a set of lines and run GH blame to open the blame view for that selection.