Skip to content

wip: macro support #198

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Draft
wants to merge 36 commits into
base: main
Choose a base branch
from
Draft

wip: macro support #198

wants to merge 36 commits into from

Conversation

Robitx
Copy link
Owner

@Robitx Robitx commented Aug 17, 2024

No description provided.

- file and topic headers not mandatory
- current conditions: .md, chat dir, header section break
- macro for target filetype (issue: #114)
(for easier use in .md buffers from obsidian and such)
(otherwise obsidian would drop it on safe)
- starting with @context_file (issue: #206)
github-actions bot and others added 2 commits September 19, 2024 09:14
- context_file => with_file
- with_current_file
- with_repo_instructions
@Robitx
Copy link
Owner Author

Robitx commented Sep 23, 2024

@teto btw. it's good to see you around. Would you be willing to try out this branch for a while? (needs "hrsh7th/nvim-cmp" as dependency for autocomplete).

I'm kinda procrastinating on merging this, any feedback would be welcome.

@teto
Copy link
Collaborator

teto commented Sep 23, 2024

What are good ways to test this ? Maybe you would get more feedback with a description in hte first message. I saw this PR yesterday but without dscription and draft status, I looked the other way :p

@Robitx
Copy link
Owner Author

Robitx commented Sep 23, 2024

@teto If you use default shortcuts, they should resolve to editable commands with some prefiled macros
image
image

For code commands such as rewrite:

@agent xy # allows changing command on the fly while writing command

@target_filetype # xy for setting filetype of new buffer made with commands such as GpEnew
@target_filename` path` # ditto as above

@with_repo_instructions serves for adding .gp.md repo instructions optionally (when present they were always added)
@with_current_buf adds current buffer for context
@with_file ` path ` adds arbitrary file for context

The last two should also be usable in chat buffers.

image

Besides this there are some additional changes concerning Chat buffers:

  • most chat logic is now handled via custom filetype (chats have markdown.gpchat, so people could use ftplugin/gpchat for customization)
  • :GpChatHelp to toggle help visibility
  • chat header uses yaml frontmatter syntax for compatibility with plugins such as Obsidian
  • chats are auto renamed to include topic.

Some startup optimizations tho shed off milliseconds for people who start new neovim instances a lot and maybe some other things I forgot in the meantime.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants