New in v17.5.0 - ✨ #{buffer}
improvements and metadata for your UI
#1975
olimorris
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello All,
It's been a while since I've done one of these and I'm almost starting to feel a little bit out of practice. Nonetheless, I thought I'd do one for version
v17.5.0
, which has some really cool features that I hope you'll love.#{buffer}
ImprovementsContext Following
As I've been using the chat buffer over the last couple of weeks, it has become an annoyance that the
#{buffer}
variable didn't automatically point to the last buffer that I was in. Instead, it pointed to the buffer that I was in when I opened the chat buffer. So, not particularly ideal. (Long story short, I could never work out how to visually let the user know what the current context that the#{buffer}
variable pointing to, was).In this release,
#{buffer}
will update when you move between buffers and will also populate a global variable_G.codecompanion_current_context
that you could leverage within your configuration. You can see that I display it in my statusline and it updates when theCodeCompanionContextChanged
andCodeCompanionRequest*
events are fired:Completion Menu
I've also made it possible for you to see within your completion menu, the list of buffers that are open and available to you use as context:
This is cached so you shouldn't notice any performance loss and it will update as you add or remove buffers. I've not tested this with anything other than blink.cmp, so please submit a PR if something isn't working.
Note
The fastest way to add multiple buffers is still with the
/buffer
slash command.Global Metadata
I'm also pleased to share that I've added a new
_G.codecompanion_chat_metadata
dictionary in this release. This allows you to programmatically access metadata about the current chat buffer that you're in. So, things like:This will make it much easier to have statuslines that update and truly reflect what's going on in the chat buffer. You can read more and find code examples in the UI page of the docs.
Below you can see my heirline.nvim config, and I note that I have a statusline that adjusts when it detects a
codecompanion
filetype (basically removing a lot of information I don't need).2025-08-13.23_21_30.-.WezTerm.mp4
Thanks
Once again, thanks for all your feedback and comments, it's always appreciated.
Beta Was this translation helpful? Give feedback.
All reactions