diff --git a/after/plugin/cmp.lua b/after/plugin/cmp.lua index cefbd0b..062839c 100644 --- a/after/plugin/cmp.lua +++ b/after/plugin/cmp.lua @@ -1,3 +1,4 @@ +require("cmp_git").setup() local cmp = require("cmp") cmp.setup({ @@ -9,8 +10,9 @@ cmp.setup({ sources = cmp.config.sources({ { name = "nvim_lsp" }, { name = "nvim_lsp_signature_help" }, - { name = "buffer" }, { name = "luasnip" }, + }, { + { name = "buffer" }, }), formatting = { format = require("lspkind").cmp_format({ @@ -18,3 +20,11 @@ cmp.setup({ }), }, }) + +cmp.setup.filetype("gitcommit", { + sources = cmp.config.sources({ + { name = "git" }, + }, { + { name = "buffer" }, + }), +}) diff --git a/lua/plugins.lua b/lua/plugins.lua index 246f8eb..74a7a84 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -51,13 +51,16 @@ return require("packer").startup(function(use) use({ "nvim-telescope/telescope.nvim", - requires = { - { "nvim-lua/plenary.nvim" }, - }, + requires = "nvim-lua/plenary.nvim", }) use({ "nvim-treesitter/nvim-treesitter", { run = ":TSUpdate" }, }) + + use({ + "petertriho/cmp-git", + requires = "nvim-lua/plenary.nvim", + }) end)