How can I attach the current buffer to the chat window everytime I toggle CodeCompanion? #1689
Replies: 3 comments 1 reply
-
It's not possible right now: #1854 |
Beta Was this translation helpful? Give feedback.
-
This happens automatically. If you type You could also use the prompt decorator feature. This has access to the context table on the chat buffer. |
Beta Was this translation helpful? Give feedback.
-
I ended up creating a custom solution to this: vim.api.nvim_create_autocmd("User", {
pattern = "CodeCompanionChatCreated",
callback = function(event)
local chat = require("codecompanion").buf_get_chat(event.data.bufnr)
if chat then
-- Insert #buffer at the end of the chat buffer
local line_count = vim.api.nvim_buf_line_count(event.data.bufnr)
vim.api.nvim_buf_set_lines(
event.data.bufnr,
line_count,
line_count,
false,
{ "", "#buffer", "" }
)
end
end,
})
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
From the documentation it looks like you can do it like this, but everytime I ask the LLM for context on the current file I'm viewing it has no idea what it's looking at.
Beta Was this translation helpful? Give feedback.
All reactions