Closed CoderCookE closed 10 months ago
Is there point in storing the prompts in Dict? You could do it in a following manner:
command! -range -nargs=? Ask call SendHighlightedCodeToChatGPT('',<q-args>)
command! -range -nargs=? Explain call SendHighlightedCodeToChatGPT('Can you explain it?', <q-args>)
command! -range -nargs=? Rewrite call SendHighlightedCodeToChatGPT('Can you rewrite it more idiomatically?', <q-args>)
...
and refactor the whole dictionary approach in the SendHighlightedCodeToChatGPT
I'll try to think about a way to add the custom prompts to the popup menu
Edit: The Dict helps selecting the function from the popup menu, probably thats why it is used
In the
chatgpt.vim
plugin, added functionality to extend the default prompt templates with user-defined custom prompts. This change allows the users to create their own prompts by defining theg:chat_gpt_custom_prompts
variable. This enhances the flexibility and applicability of the ChatGPT plugin in different usage scenarios.To add new prompts or override existing prompts:
ToDo: Fix the popup menu.