Files
gitea.nvim/doc/gitea.nvim.md

1.7 KiB
Raw Blame History

gitea.nvim

gitea.nvim allows you to manage Gitea issues and pull requests from Neovim, inspired by octo.nvim.

Features

  • Stores a Gitea token securely, optionally adding it to .gitignore.
  • Tries to auto-detect the Gitea host from your .git/config or prompts for it.
  • List, open, comment, and create issues.
  • List, open, comment, and merge pull requests.
  • Create a local Git branch for an issue.

Installation

Using packer.nvim:

use {
  'youruser/gitea.nvim',
  requires = { 'nvim-lua/plenary.nvim' },
  config = function()
    require('gitea').setup()
  end
}

Configuration

require('gitea').setup({
  base_url = "https://gitea.example.com",
  token_file = vim.fn.stdpath('config') .. "/.gitea_token",
  preview_style = "floating", -- or "split"
})

Usage (Commands)

  • :GiteaListIssues <owner> <repo>
  • :GiteaOpenIssue <owner> <repo> <issue_number>
  • :GiteaCreateIssue <owner> <repo> <title> <body...>
  • :GiteaListComments <owner> <repo> <issue_number>
  • :GiteaAddComment <owner> <repo> <issue_number> <comment...>
  • :GiteaCreateBranchForIssue <owner> <repo> <issue_number>
  • :GiteaListPRs <owner> <repo>
  • :GiteaOpenPR <owner> <repo> <pr_number>
  • :GiteaCommentPR <owner> <repo> <pr_number> <comment...>
  • :GiteaMergePR <owner> <repo> <pr_number>

Common Issues

  • Circular Dependency: Previously, commands.lua required init.lua while init.lua required commands.lua. The updated approach removes that loop by passing the plugins table to commands.setup_commands.

License

MIT License