Skip to content
mistweavercoPublic

About

πŸ™ ndoo.nvim - simple utils for working with Github, Bitbucket and GitLab inside Neovim.

Topics

Resources

Stars

15 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

41 Commits

Folders and files

Repository files navigation

Ndoo Logo

ndoo.nvim

Lua GitHub release (latest by date)

Requirements β€’ Install β€’ Usage

A minimal Git-Multi-Platform Interface for Neovim.

Ndoo is swahili for "bucket".

It has nothing to do with bitbucket, but it's a cool name for a collection of a Git-Multi-Platform Interface.

It gives you quick access to your Github, GitLab, Bitbucket, Gitea, and Forgejo repositories from within Neovim.

Requirements

  • Neovim (tested with 0.9.0)

  • telescope.nvim or fzf-lua for pickers

  • git

  • For Github Integration:

  • For Bitbucket Integration:

  • For Gitea / Forgejo Integration:

    • Either tea (Gitea CLI) or fj (Forgejo CLI). ndoo uses whichever is installed; if both are present, fj is preferred.

Install

Via lazy.nvim:

with telescope.nvim:

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

or with fzf-lua:

require('lazy').setup({
  -- Github Integration
  {
    'mistweaverco/ndoo.nvim',
    dependencies = {
      'ibhagwan/fzf-lua'
    }
  },
})

Configfile

Create a ~/.config/ndoo/config.json file with the following content:

{
  "bitbucket_use_jira_issues": true,
  "bitbucket_username": "gorillamoe",
  "bitbucket_app_password": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "gitea_hosts": ["git.example.com", "source.mycompany.io"]
}

Bitbucket

The bitbucket_use_jira_issues key is optional and only needed if you want to use the Jira integration in your Bitbucket repositories.

The bitbucket_username and bitbucket_app_password are required for the Bitbucket integration.

You can obtain the bitbucket_app_password by going to your Bitbucket settings and creating a new app password. The username is your Bitbucket username.

Gitea / Forgejo

Authentication is handled entirely by your CLI of choice β€” ndoo stores no token. Install one:

  • fj (Forgejo CLI, also works with Gitea) β€” keyring auth:

    fj auth login          # OAuth
    fj auth add-key <user> # token
  • tea (Gitea CLI, also works with Forgejo) β€” file auth, and can act as a Git credential helper:

    tea login add --url https://git.example.com --token xxx
    tea login helper setup   # optional: silent git push/pull over HTTPS

If both are installed, ndoo uses fj. To force tea, uninstall or shadow fj on your PATH.

Host detection

A remote is treated as Gitea/Forgejo when its hostname is:

  1. one of codeberg.org, gitea.com, forgejo.org, or
  2. matched by ^git. (e.g. git.example.com), or
  3. listed in gitea_hosts (exact match or parent-domain match).

Set "gitea_disable_git_heuristic": true to turn off rule 2.

Both SSH (git@host:owner/repo.git) and HTTPS remotes are supported. SSH remotes default to https:// for web URLs; HTTP remotes (including non-standard ports like http://localhost:3000) are preserved as-is.

Public methods

require('ndoo').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('ndoo').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('ndoo').repo()

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

repo

require('ndoo').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('ndoo').pulls()

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

pulls

require('ndoo').issues()

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

issues

require('ndoo').pipelines()

Takes you to the web-view of the pipelines.

actions

require('ndoo').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 = "Git Utils",
        o = { "<Cmd>lua require('ndoo').open()<CR>", "Open" },
        O = { "<Cmd>lua require('ndoo').open({ commit = true })<CR>", "Open commit" },
        r = { "<Cmd>lua require('ndoo').repo()<CR>", "Repo" },
        c = { "<Cmd>lua require('ndoo').commit()<CR>", "Commit" },
        p = { "<Cmd>lua require('ndoo').pulls()<CR>", "Pulls" },
        i = { "<Cmd>lua require('ndoo').issues()<CR>", "Issues" },
        a = { "<Cmd>lua require('ndoo').pipelines()<CR>", "Pipelines" },
        l = { "<Cmd>lua require('ndoo').labels()<CR>", "Labels" },
      },
  },
}, { prefix = "<leader>" })

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

About

πŸ™ ndoo.nvim - simple utils for working with Github, Bitbucket and GitLab inside Neovim.

Topics

Resources

Stars

15 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages