Skip to content

Commit

Permalink
feat(completion): add cmp-git (#950)
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter authored May 8, 2024
1 parent 33c53e1 commit a22872f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/astrocommunity/completion/cmp-git/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# cmp-git

Git source for nvim-cmp

**Repository:** <https://github.com/petertriho/cmp-git>
21 changes: 21 additions & 0 deletions lua/astrocommunity/completion/cmp-git/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
return {
"petertriho/cmp-git",
ft = { "gitcommit", "octo" },
dependencies = { "hrsh7th/nvim-cmp" },
opts = function(_, opts)
opts.filetypes = require("lazy.core.plugin").values(assert(require("astrocore").get_plugin "cmp-git"), "ft")
end,
config = function(_, opts)
if opts.filetypes then
local cmp = require "cmp"
cmp.setup.filetype(opts.filetypes, {
sources = cmp.config.sources({
{ name = "git" },
}, {
{ name = "buffer" },
}),
})
end
require("cmp_git").setup(opts)
end,
}

0 comments on commit a22872f

Please sign in to comment.