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

[Feature Request] Highlight text to send it to ChatGPT with instructions

Open ben-wall opened this issue 2 years ago • 2 comments

One of my most common developer use cases for chatgpt involves pasting some code and asking for an amendment, fix or explanation to that snippet...

I've tried changing the edit_with_instructions() model to the chatGPT one, but understandably it just errors.

What I'd like is the same functionality as that, but for it to go to chatgpt and not davinci code.

:ChatGPTWithInstructions could take the visually selected code, allow you to add text to the request body with the input as before and send the whole thing off to chatpgt. If no text is added by you, it just sends the code snippet itself.

Without this functionality I only have about 10% usability for this plugin whilst inside of vim.

ben-wall avatar Mar 07 '23 22:03 ben-wall

The work around I found for this, is to create an empty buffer. Then dump the code plus comments I want into that buffer. In some cases, code from multiple files, not something that can just be visually selected. Once buffer is ready call :ChatGPTWithInstructions. Works pretty well IMO.

sahglie avatar Mar 10 '23 20:03 sahglie

The work around I found for this, is to create an empty buffer. Then dump the code plus comments I want into that buffer. In some cases, code from multiple files, not something that can just be visually selected. Once buffer is ready call :ChatGPTWithInstructions. Works pretty well IMO.

Thanks, but as I mentioned, this does not use ChatGPT model and can't be changed to use it as it throws an error.

ben-wall avatar Mar 12 '23 14:03 ben-wall

Looks like code-davinci-edit-001 is being deprecated in favour of 3.5 anyway so @jackMort will have to change it over pretty soon (hopefully very soon I can't wait for this to work!) This ticket should be closed once that's done.

ben-wall avatar Mar 21 '23 11:03 ben-wall

Isn't a custom action.json enough?

00sapo avatar Mar 23 '23 06:03 00sapo