-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchatgpt.lua
34 lines (34 loc) · 959 Bytes
/
chatgpt.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
return {
"jackMort/ChatGPT.nvim",
cmd = {
"ChatGPT",
"ChatGPTRun",
"ChatGPTActAs",
"ChatGPTCompleteCode",
"ChatGPTEditWithInstructions",
},
config = function()
local home_dir = vim.loop.os_homedir()
-- local gpg_file_path
local key_path
if home_dir then
-- gpg_file_path = vim.fn.fnameescape(home_dir) .. "/OpenAIkey.gpg"
key_path = vim.fn.fnameescape(home_dir) .. "/OpenAIkey.txt"
end
local display_cmd
if string.match(vim.loop.os_uname().sysname, "Windows") then
display_cmd = "type " -- Windows
else
display_cmd = "cat " -- UNIX-like
end
require("chatgpt").setup({
-- api_key_cmd = "gpg --decrypt " .. gpg_file_path
api_key_cmd = display_cmd .. key_path,
})
end,
dependencies = {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
},
}