-
-
Notifications
You must be signed in to change notification settings - Fork 119
Examples and Tips
Tomas Slusny edited this page Mar 14, 2025
·
2 revisions
Set up a quick chat command that uses the entire buffer content:
-- Quick chat keybinding
vim.keymap.set('n', '<leader>ccq', function()
local input = vim.fn.input("Quick Chat: ")
if input ~= "" then
require("CopilotChat").ask(input, {
selection = require("CopilotChat.select").buffer
})
end
end, { desc = "CopilotChat - Quick chat" })
Configure the chat window to appear inline near the cursor:
require("CopilotChat").setup({
window = {
layout = 'float',
relative = 'cursor',
width = 1,
height = 0.4,
row = 1
}
})
Requires PerplexityAI Agent:
vim.keymap.set({ 'n', 'v' }, '<leader>ccs', function()
local input = vim.fn.input("Perplexity: ")
if input ~= "" then
require("CopilotChat").ask(input, {
agent = "perplexityai",
selection = false,
})
end
end, { desc = "CopilotChat - Perplexity Search" })
Use render-markdown.nvim for better chat display:
-- Register copilot-chat filetype
require('render-markdown').setup({
file_types = { 'markdown', 'copilot-chat' },
})
-- Adjust chat display settings
require('CopilotChat').setup({
highlight_headers = false,
separator = '---',
error_header = '> [!ERROR] Error',
})