gp.nvim icon indicating copy to clipboard operation
gp.nvim copied to clipboard

wip: macro support

Open Robitx opened this issue 1 year ago • 3 comments

Robitx avatar Aug 17 '24 22:08 Robitx

@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.

Robitx avatar Sep 23 '24 12:09 Robitx

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

teto avatar Sep 23 '24 12:09 teto

@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.

Robitx avatar Sep 23 '24 13:09 Robitx