diff --git a/init.lua b/init.lua index 622f35c..e1144d8 100644 --- a/init.lua +++ b/init.lua @@ -9,7 +9,7 @@ require("user.bufferline") if onsave then require("user.format_onsave") end - +require("user.chat_gpt") -- dipindah ke plugins -- require("user.lualine") -- require("user.cmp") diff --git a/lazy-lock.json b/lazy-lock.json index c64f810..a81d1e2 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,4 +1,5 @@ { + "ChatGPT.nvim": { "branch": "main", "commit": "c33babb015005cda6042f908ac587e4bc498d041" }, "Comment.nvim": { "branch": "master", "commit": "97a188a98b5a3a6f9b1b850799ac078faa17ab67" }, "LuaSnip": { "branch": "master", "commit": "563827f00bb4fe43269e3be653deabc0005f1302" }, "alpha-nvim": { "branch": "main", "commit": "0bb6fc0646bcd1cdb4639737a1cee8d6e08bcc31" }, @@ -29,6 +30,7 @@ "mini.pairs": { "branch": "main", "commit": "fec9aba50912d8c3d92d07d6a77952de84f8d7ad" }, "mini.surround": { "branch": "main", "commit": "df41f1c009afbb3eef39d979977fb14404576f9b" }, "neoscroll.nvim": { "branch": "master", "commit": "d7601c26c8a183fa8994ed339e70c2d841253e93" }, + "nui.nvim": { "branch": "main", "commit": "b99e6cb13dc51768abc1c4c8585045a0c0459ef1" }, "null-ls.nvim": { "branch": "main", "commit": "c0c19f32b614b3921e17886c541c13a72748d450" }, "nvim-autopairs": { "branch": "master", "commit": "4fc96c8f3df89b6d23e5092d31c866c53a346347" }, "nvim-cmp": { "branch": "main", "commit": "983453e32cb35533a119725883c04436d16c0120" }, diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index b9c7fb6..f81dce4 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -380,4 +380,12 @@ return { require("user.mason_dap") 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, + }, } diff --git a/lua/user/chat_gpt.lua b/lua/user/chat_gpt.lua new file mode 100644 index 0000000..5022bbb --- /dev/null +++ b/lua/user/chat_gpt.lua @@ -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 = { "", "" }, + yank_last = "", + scroll_up = "", + scroll_down = "", + toggle_settings = "", + new_session = "", + cycle_windows = "", + }, +})