Closed argshook closed 2 months ago
just what I was looking for...hope this gets merged soon 🤞
Hey @marcomayer 👋🏻 you can try out my fork, until (and if) this gets merged to upstream.
Wrote about how to do that here
i see this PR now includes more than needed, because it points to the main
branch of my fork, instead of a more appropriate one.
I'll try to remember about it and find time to update 🤞🏻
@argshook Hey, I've cherry picked and slightly adjusted the
https://github.com/Robitx/gp.nvim/pull/117/commits/0b6fc73898dca19ad303691b504b3dc71fea116d
chat template now uses {{tags}} instead of %s
M.chat_template = [[
# topic: ?
- file: {{filename}}
{{optional_headers}}
Write your queries after {{user_prefix}}. Use `{{respond_shortcut}}` or :{{cmd_prefix}}ChatRespond to generate a response.
Response generation can be terminated by using `{{stop_shortcut}}` or :{{cmd_prefix}}ChatStop command.
Chats are saved automatically. To delete this chat, use `{{delete_shortcut}}` or :{{cmd_prefix}}ChatDelete.
Be cautious of very long chats. Start a fresh chat by using `{{new_shortcut}}` or :{{cmd_prefix}}ChatNew.
---
{{user_prefix}}
]]
gp.defaults
chat_template = require("gp.defaults").chat_template,
-- if you want more real estate in your chat files and don't need the helper text
-- chat_template = require("gp.defaults").short_chat_template,
Hey @Robitx 👋🏻
this is great, thanks a lot! and pardon for leaving the PR in such a state, my mistake for pointing the PR from main
branch of my fork.
Anyway, thanks for your work, the plugin is still kickin'!
Hello again :wave:
Your plugin is still amazing, thanks once more for working on it and keeping it open source!
This PR adds a new config option:
chat_template
. The default messaging is good, but as i'm familiar with how the plugin works, I don't need to be reminded about the shortcuts each time.Therefore, i'd like to configure that message, but couldn't find a way to do so. Maybe i missed it?
A bit naive but very simple way is to expose
chat_template
to be configurable. If user decides to set it, then it is up to them to set it correctly.If
chat_template
is not set, nothing changes and the current message is shown. So no impact for existing users.Having
chat_template
config option i'm able to:and now each chat file looks like:
which is neat, much cleaner!
additional thought is that perhaps markdown frontmatter would fit here for the banner? It is often used to set some extra properties that are not part of markdown body. Lua probably already has some utilities to deal with frontmatter, so chances are it might be easy addition (i'm lua noob, i wouldn't know!).
Anyway, thanks for the plugin, just wanted to share my 2 cents.
Cheers!