David-Kunz / gen.nvim

Neovim plugin to generate text using LLMs with customizable prompts
The Unlicense
1.15k stars 92 forks source link

Add "$file" option to cmd substitution #110

Closed Chewt closed 3 days ago

Chewt commented 2 months ago

The $file option in cmd substitution functions similarly to the $body substitution, however it writes to a temporary file instead of including it in the command, and instead puts the filename in the command. This allows for longer contexts to be passed to curl.

This PR is related to #108

Feel free to suggest changes to this before merging, for example if you don't like the way I implemented it and would prefer a different strategy. I have tested that this works and addresses the issues in the mentioned issue.

David-Kunz commented 3 days ago

Hi @Chewt ,

Thanks a lot for this PR, I slightly modified it and committed it with https://github.com/David-Kunz/gen.nvim/commit/bf8db7739d5020cad1f9fc5e45dd1a99fd1d39c2

You can now set option file = true to temporarily store it in a file!

Best regards, David