New in v2.0.0 to v2.2.0 - ✨ Slash Commands and more #173
Replies: 1 comment 4 replies
-
Thanks for all the effort on these features! I do have one question though about the folds you showed in the video—how did you do that? I tried using
Are you referring to your config or is this part of the plugin? I noticed the function I really don't like folds in neovim, but I have to use it sometimes. Thank you! |
Beta Was this translation helpful? Give feedback.
-
Slash Commands
Slash.Commands.mp4
Slash Commands (as per 91adfac) have now been added. See the Zed AI blog post which showcases how they use them. A big shout out to @SDGLBL who showcased how this could be possible in the plugin in this PR.
As you'll see from the config, Slash Commands are trivial to extend. And in #167 we had the first PR which added mini.pick to the file Slash Command. I sincerely hope more of you can add the providers that you use in your own config besides Telescope.
The challenge in adding Slash Commands was actually around the folding of the code in the chat buffer. I wanted code to be automatically folded and also wanted users to be able to import a file and then edit its code in the buffer...after all you may only want to share a function or two from the file. The challenge with the latter was that
manual
folding (where you define a region), breaks if a user edits their imported code. So I triedexpr
folds where I used Tree-sitter...I just couldn't get that to work even with my ownfolds.scm
file. I tried my own customexpr
function which just felt expensive and high latency. So in the end I wrote my own custom Tree-sitter query which parses the user messages and sets the fold manually...I'm falling asleep just sharing this with you 😆 .Currently there are two Slash Commands:
/file
- to share a file in your repository (leveragestelescope
ormini.pick
)/buffer
- to share a buffer (leverages nativevim.ui.select
or `telescope)Please try them out, feedback and share your suggestions for more commands.
Custom Token Output
b68a283 added the ability to format the token output message in the chat buffer.
Roadmap
There's a few things I want to tidy up (improved cache prompting with Anthropic, some bug fixes) before I move onto Tools and especially the ability to update your code base from the Chat Buffer.
Beta Was this translation helpful? Give feedback.
All reactions