Files
dotfiles/nvim/lua/kickstart/plugins/copilot_chat.lua
2026-03-12 12:35:37 +05:30

93 lines
2.1 KiB
Lua

return {
"CopilotC-Nvim/CopilotChat.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
"nvim-tree/nvim-web-devicons",
{ "nvim-lua/plenary.nvim", branch = "master" },
},
build = "make tiktoken",
suggestion = {
enabled = true,
auto_trigger = true,
debounce=50,
},
opts = {
window = {
layout = "vertical",
width = 0.4, -- Fixed width in columns
height = 0.5, -- Fixed height in rows
border = "double", -- 'single', 'double', 'rounded', 'solid'
title = "🤖 AI Assistant",
zindex = 100, -- Ensure window stays on top
},
headers = {
user = "👤 You",
assistant = "🤖 Copilot",
tool = "🔧 Tool",
},
separator = "━━",
auto_fold = true, -- Automatically folds non-assistant messages
},
-- Model selection
model = "gpt-4", -- 'gpt-4' | 'gpt-3.5-turbo'
-- Temperature for responses (0-1, higher = more creative)
temperature = 0.1,
-- Question header
question_header = "## 👤 User ",
-- Answer header
answer_header = "## 🤖 Copilot ",
-- Error header
error_header = "## ❌ Error ",
-- Separator between messages
separator = " ",
-- Show help text
show_help = true,
-- Show folds for sections
show_folds = true,
-- Auto-follow cursor in chat window
auto_follow_cursor = true,
-- Auto-insert mode when opening chat
auto_insert_mode = false,
-- Clear chat on new conversation
clear_chat_on_new_prompt = false,
-- Context for conversations
context = nil,
-- Prompts (custom quick actions)
prompts = {
Explain = {
prompt = "/COPILOT_EXPLAIN Write an explanation for the active selection as paragraphs of text.",
},
Review = {
prompt = "/COPILOT_REVIEW Review the selected code.",
},
Fix = {
prompt = "/COPILOT_GENERATE There is a problem in this code. Rewrite the code to show it with the bug fixed.",
},
Optimize = {
prompt = "/COPILOT_GENERATE Optimize the selected code to improve performance and readability.",
},
Docs = {
prompt = "/COPILOT_GENERATE Please add documentation comment for the selection.",
},
Tests = {
prompt = "/COPILOT_GENERATE Please generate tests for my code.",
},
},
}