dotfiles/nvim/lua/custom/chatgpt/config.lua

64 lines
1.6 KiB
Lua
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

local LOGO = [[
____ ___ ____ ________ __ __________ ______
/ __ \____ ___ ____ / | / _/ / ____/ /_ ____ _/ /_/ ____/ __ \/_ __/
/ / / / __ \/ _ \/ __ \/ /| | / / / / / __ \/ __ `/ __/ / __/ /_/ / / /
/ /_/ / /_/ / __/ / / / ___ |_/ / / /___/ / / / /_/ / /_/ /_/ / ____/ / /
\____/ .___/\___/_/ /_/_/ |_/___/ \____/_/ /_/\__,_/\__/\____/_/ /_/
/_/
Not actually ChatGPT, but preserve the conversation with GPT-3
]]
local M = {}
function M.defaults()
local defaults = {
logo = LOGO,
signs = { prompt = "", answer = "", code = "", error = "" },
progress = { "|", "/", "-", "\\" },
highlights = {
prompt = "ChatGPTPrompt",
code = "ChatGPTPrompt",
logo = "ChatGPTLogo",
answer = "ChatGPTAnswer",
error = "ChatGPTError",
selected = "ChatGPTSelected"
},
chat_window = {
filetype = "chatgpt",
border = {
highlight = "FloatBorder",
style = "rounded",
text = { top = " ChatGPT " }
}
},
chat_input = {
prompt = "> ",
size = { height = 4 },
border = {
highlight = "FloatBorder",
style = "rounded",
text = { top_align = "center", top = " Prompt " }
},
win_options = { winhighlight = "Normal:Normal" }
},
layout = {
relative = "editor",
position = "50%",
size = { width = "80%", height = "80%" }
}
}
return defaults
end
M.options = {}
function M.setup(options)
options = options or {}
M.options = vim.tbl_deep_extend("force", M.defaults(), options)
end
return M