update chatGPT

This commit is contained in:
asep komarudin 2023-01-19 00:00:48 +07:00
parent 6968e42f10
commit 64d3a5acef
4 changed files with 80 additions and 1 deletions

View file

@ -9,7 +9,7 @@ require("user.bufferline")
if onsave then if onsave then
require("user.format_onsave") require("user.format_onsave")
end end
require("user.chat_gpt")
-- dipindah ke plugins -- dipindah ke plugins
-- require("user.lualine") -- require("user.lualine")
-- require("user.cmp") -- require("user.cmp")

View file

@ -1,4 +1,5 @@
{ {
"ChatGPT.nvim": { "branch": "main", "commit": "c33babb015005cda6042f908ac587e4bc498d041" },
"Comment.nvim": { "branch": "master", "commit": "97a188a98b5a3a6f9b1b850799ac078faa17ab67" }, "Comment.nvim": { "branch": "master", "commit": "97a188a98b5a3a6f9b1b850799ac078faa17ab67" },
"LuaSnip": { "branch": "master", "commit": "563827f00bb4fe43269e3be653deabc0005f1302" }, "LuaSnip": { "branch": "master", "commit": "563827f00bb4fe43269e3be653deabc0005f1302" },
"alpha-nvim": { "branch": "main", "commit": "0bb6fc0646bcd1cdb4639737a1cee8d6e08bcc31" }, "alpha-nvim": { "branch": "main", "commit": "0bb6fc0646bcd1cdb4639737a1cee8d6e08bcc31" },
@ -29,6 +30,7 @@
"mini.pairs": { "branch": "main", "commit": "fec9aba50912d8c3d92d07d6a77952de84f8d7ad" }, "mini.pairs": { "branch": "main", "commit": "fec9aba50912d8c3d92d07d6a77952de84f8d7ad" },
"mini.surround": { "branch": "main", "commit": "df41f1c009afbb3eef39d979977fb14404576f9b" }, "mini.surround": { "branch": "main", "commit": "df41f1c009afbb3eef39d979977fb14404576f9b" },
"neoscroll.nvim": { "branch": "master", "commit": "d7601c26c8a183fa8994ed339e70c2d841253e93" }, "neoscroll.nvim": { "branch": "master", "commit": "d7601c26c8a183fa8994ed339e70c2d841253e93" },
"nui.nvim": { "branch": "main", "commit": "b99e6cb13dc51768abc1c4c8585045a0c0459ef1" },
"null-ls.nvim": { "branch": "main", "commit": "c0c19f32b614b3921e17886c541c13a72748d450" }, "null-ls.nvim": { "branch": "main", "commit": "c0c19f32b614b3921e17886c541c13a72748d450" },
"nvim-autopairs": { "branch": "master", "commit": "4fc96c8f3df89b6d23e5092d31c866c53a346347" }, "nvim-autopairs": { "branch": "master", "commit": "4fc96c8f3df89b6d23e5092d31c866c53a346347" },
"nvim-cmp": { "branch": "main", "commit": "983453e32cb35533a119725883c04436d16c0120" }, "nvim-cmp": { "branch": "main", "commit": "983453e32cb35533a119725883c04436d16c0120" },

View file

@ -380,4 +380,12 @@ return {
require("user.mason_dap") require("user.mason_dap")
end, end,
}, },
-- for codeGPT
{
"jackMort/ChatGPT.nvim",
dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim" },
-- init = function()
-- require("user.chat_gpt")
-- end,
},
} }

69
lua/user/chat_gpt.lua Normal file
View file

@ -0,0 +1,69 @@
require("chatgpt").setup({
welcome_message = WELCOME_MESSAGE, -- set to "" if you don't like the fancy godot robot
loading_text = "loading",
question_sign = "", -- you can use emoji if you want e.g. 🙂
answer_sign = "", -- 🤖
max_line_length = 120,
yank_register = "+",
chat_layout = {
relative = "editor",
position = "50%",
size = {
height = "80%",
width = "80%",
},
},
settings_window = {
border = {
style = "rounded",
text = {
top = " Settings ",
},
},
},
chat_window = {
filetype = "chatgpt",
border = {
highlight = "FloatBorder",
style = "rounded",
text = {
top = " ChatGPT ",
},
},
},
chat_input = {
prompt = "",
border = {
highlight = "FloatBorder",
style = "rounded",
text = {
top_align = "center",
top = " Prompt ",
},
},
},
openai_params = {
model = "text-davinci-003",
frequency_penalty = 0,
presence_penalty = 0,
max_tokens = 300,
temperature = 0,
top_p = 1,
n = 1,
},
openai_edit_params = {
model = "code-davinci-edit-001",
temperature = 0,
top_p = 1,
n = 1,
},
keymaps = {
close = { "<C-c>", "<Esc>" },
yank_last = "<C-y>",
scroll_up = "<C-u>",
scroll_down = "<C-d>",
toggle_settings = "<C-o>",
new_session = "<C-n>",
cycle_windows = "<Tab>",
},
})