Skip to content

mistweaverco/githubutils.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

28 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GithubUtils.nvim

πŸ™ GithubUtils.nvim - simple utils for working with Github inside Neovim.

Requirements

Installation

Via lazy.nvim:

require('lazy').setup({
  -- Github Integration
  { 'mistweaverco/githubutils.nvim', dependencies = 'nvim-telescope/telescope.nvim' },
})

Public methods

require('githubutils').open()

Opens up the Github Web-IDE with the current line pre-selected (on the current branch).

open normal mode

Can be used from visual mode when passing { v = true } (require('githubutils').open({ v = true })) which will then pre-select the visually selected lines (on the current branch).

open visual mode

NOTE: additionally commit = true can be passed which will open the current commit, rather than the current branch.

require('githubutils').repo()

Opens up the base Github page of the current git repository you're in.

repo

require('githubutils').commit()

Prompts you for a commit hash and opens up the Github web-view of this commit.

commit

If you leave the prompt empty and press enter, the Github web-view of all commits for the current branch will be opened.

commit blank

require('githubutils').pulls()

Lists all open pull-requests. Takes you to the web-view of the pull-request selected.

pulls

require('githubutils').issues()

Lists all open issues. Takes you to the web-view of the issue selected.

issues

require('githubutils').actions()

Takes you to the web-view of the actions.

actions

require('githubutils').labels()

Lists all labels. Takes you to the web-view of the label selected.

labels

Configuration

With which-key.nvim:

-- Mappings for normal mode
wk.register({
  g = {
    name = "Goto",
      h = {
        name = "Github Utils",
        o = { "<Cmd>lua require('githubutils').open()<CR>", "Open" },
        O = { "<Cmd>lua require('githubutils').open({ commit = true })<CR>", "Open commit" },
        r = { "<Cmd>lua require('githubutils').repo()<CR>", "Repo" },
        c = { "<Cmd>lua require('githubutils').commit()<CR>", "Commit" },
        p = { "<Cmd>lua require('githubutils').pulls()<CR>", "Pulls" },
        i = { "<Cmd>lua require('githubutils').issues()<CR>", "Issues" },
        a = { "<Cmd>lua require('githubutils').actions()<CR>", "Actions" },
        l = { "<Cmd>lua require('githubutils').labels()<CR>", "Actions" },
      },
  },
}, { prefix = "<leader>" })

-- Mappings for visual mode
wk.register({
  g = {
    name = "Goto",
      h = {
        name = "Github Utils",
        o = { "<Cmd>lua require('githubutils').open({ v = true })<CR>", "Open" },
        O = { "<Cmd>lua require('githubutils').open({ v = true, commit = true })<CR>", "Open commit" },
      },
  },
}, { prefix = "<leader>", mode = "v" })

About

πŸ™ GithubUtils.nvim - simple utils for working with Github inside Neovim

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages