🐛 fix(nvim): added condition for chatgpt to run when api key is set

This commit is contained in:
Sergio Laín 2023-12-07 23:27:41 +01:00
parent 03ad7f74cf
commit 22239d71cf
No known key found for this signature in database
GPG key ID: 14C9B8080681777B

View file

@ -1,8 +1,16 @@
return {
{
"jackMort/ChatGPT.nvim",
dependencies = {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
},
cond = function()
local api_key = os.getenv("OPENAI_API_KEY")
return api_key and api_key ~= "" and true or false
end,
opts = {
api_key_cmd = nil, --TODO: manage the API key
edit_with_instructions = {
diff = false,
keymaps = {