nvim: copilot and chatgpt

This commit is contained in:
Daniel Meiburg 2023-07-23 17:52:50 +02:00
parent 5f0e861fdd
commit fbdda9d41f
Signed by: dm
GPG Key ID: E5827ECFFE0AA4F2
4 changed files with 30 additions and 9 deletions

View File

@ -0,0 +1,3 @@
require("chatgpt").setup({
api_key_cmd = "pass api/chatgpt_neovim",
})

View File

@ -21,15 +21,15 @@ cmp.setup {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
},
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { 'i', 's' }),
--['<Tab>'] = cmp.mapping(function(fallback)
-- if cmp.visible() then
-- cmp.select_next_item()
-- elseif luasnip.expand_or_jumpable() then
-- luasnip.expand_or_jump()
-- else
-- fallback()
-- end
--end, { 'i', 's' }),
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()

View File

@ -26,5 +26,18 @@ return require('packer').startup(function(use)
use 'lukas-reineke/indent-blankline.nvim'
use 'lewis6991/gitsigns.nvim'
use 'github/copilot.vim'
use({
"jackMort/ChatGPT.nvim",
config = function()
require("chatgpt").setup()
end,
requires = {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim"
}
})
end)

View File

@ -95,6 +95,11 @@ _G.packer_plugins = {
path = "/home/dm/.local/share/nvim/site/pack/packer/start/cmp_luasnip",
url = "https://github.com/saadparwaiz1/cmp_luasnip"
},
["copilot.vim"] = {
loaded = true,
path = "/home/dm/.local/share/nvim/site/pack/packer/start/copilot.vim",
url = "https://github.com/github/copilot.vim"
},
["gitsigns.nvim"] = {
loaded = true,
path = "/home/dm/.local/share/nvim/site/pack/packer/start/gitsigns.nvim",