cmp-git
🚧 WORK IN PROGRESS 🚧
This is a work in prgress and breaking changes to the setup/config could occur in the future. Sorry for any inconveniences.
Git source for hrsh7th/nvim-cmp
-
#
to triggerissues
completion -
@
to triggermentions
(contributors) completion -
!
to triggermerge requests
completion (GitLab only)
Requirements
- Neovim >= 0.5.1
- git
- curl
- GitHub CLI (optional, will use curl instead if not avaliable)
- GitLab CLI (unofficial) (optional, will use curl instead if not avaliable)
GitHub Private Repositories
curl
: Generate token withrepo
scope. SetGITHUB_API_TOKEN
environment variable.GitHub CLI
: Run gh auth login
GitLab Private Repositories
curl
Generate token withapi
scope. SetGITLAB_TOKEN
environment variable.GitLab CLI
: Run glab auth login
Installation
Plug 'nvim-lua/plenary.nvim'
Plug 'petertriho/cmp-git'
use("petertriho/cmp-git", requires = "nvim-lua/plenary.nvim")
Setup
require("cmp").setup({
sources = {
{ name = "cmp_git" },
-- more sources
}
})
require("cmp_git").setup({
-- defaults
filetypes = { "gitcommit" },
github = {
issues = {
filter = "all", -- assigned, created, mentioned, subscribed, all, repos
limit = 100,
state = "open", -- open, closed, all
},
mentions = {
limit = 100,
},
},
gitlab = {
issues = {
limit = 100,
state = "opened", -- opened, closed, all
},
mentions = {
limit = 100,
},
merge_requests = {
limit = 100,
state = "opened", -- opened, closed, locked, merged
},
},
})
Acknowledgements
Special thanks to tjdevries for their informative video and starting code.