feat: first implementation for issues and pull requests

This commit is contained in:
2024-12-29 20:50:50 +01:00
parent dd6843091b
commit f46f60b723
13 changed files with 1248 additions and 859 deletions

57
doc/gitea.nvim.md Normal file
View File

@@ -0,0 +1,57 @@
# gitea.nvim
**gitea.nvim** allows you to manage [Gitea](https://gitea.io/) issues and pull requests from Neovim,
inspired by [octo.nvim](https://github.com/pwntester/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](https://github.com/wbthomason/packer.nvim):
```lua
use {
'youruser/gitea.nvim',
requires = { 'nvim-lua/plenary.nvim' },
config = function()
require('gitea').setup()
end
}
```
## Configuration
```lua
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