-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add config.chat_template
to be able to customize the chat file banner
#117
Open
argshook
wants to merge
12
commits into
Robitx:main
Choose a base branch
from
argshook:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.chat_template
to be able to customize the chat file bannerconfig.chat_template
to be able to customize the chat file banner
`gp.nvim` has autosave feature which is triggered by few events, one of which is `TextChangedI`. when typing text in insert mode, any change done there saves the file. This grows the `:undolist` too much, because any change in insert mode is saved and treated as a separate change. Normally to undo the last change, you would press `u` once in normal mode. But with autosave triggered by `TextChangedI`, you have to press `u` multiple times, for each change. using `InsertLeave` instead of `TextChangedI` avoids such problem. For comparison, consider scenario: 1. open neovim 2. run `:GpChatNew` 3. go to insert mode and type `123` 4. leave insert mode 5. run `:undolist` on my setup it shows: ``` number changes when saved 4 4 2 seconds ago ``` doing the equivalent when `InsertLeave` is used instead of `TextChangedI`: ``` number changes when saved 1 1 2 seconds ago 1 ``` this is much better, because now you can undo the last change with single `u` press!
fixes the error: ``` ln: failed to create symbolic link 'chats/last.md': Directory not empty ```
- Set `model` parameter to "gpt-4o" in both chat and command configurations.
Add a prominent note about this repo being a fork with improvements.
this changes the `{{filename}}` substitute in templates to point to a relative path from the `.git` repository. If `.git` repository is not found, then full path is used. With this change commands like `:GpChatPaste` would include a less verbose path without including the username. For example with config like this: ```lua template_selection = "from `{{filename}}`" ``` we now get ``` from `my-project/file.py` ``` previously we would get ``` from `/home/username/projects/repositories/my-project/file.py` ``` which is often excessive and also leaks the username.
just what I was looking for...hope this gets merged soon 🤞 |
Hey @marcomayer 👋🏻 Wrote about how to do that here i see this PR now includes more than needed, because it points to the I'll try to remember about it and find time to update 🤞🏻 |
@argshook Hey, I've cherry picked and slightly adjusted the
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello again 👋
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!