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

Inline directly into current buffer

Open orhnk opened this issue 1 year ago • 4 comments

The :CodyDo "<query>" popup is cool

but It'd be better to have a command that will inline CodyDo to your buffer cursor position.

orhnk avatar Aug 20 '23 07:08 orhnk

It would also be neat to see CodyDo replace selected text if it was invoked in visual mode. If that's too intrusive for default behavior, perhaps a keybinding that "accepts" the text in the floating buffer would be better.

mattvaughan avatar Aug 21 '23 05:08 mattvaughan

@mattvaughan so you can do :CodyTaskAccept in the floating buffer and it will replace the text on which the task was performed.

You can bind that to a keystroke of your choosing if you want :)

pjlast avatar Aug 23 '23 14:08 pjlast

@pjlast I think He actually meant something similar to me.

Project needs some interactivity. I think the popup is redundant.

Why not inline it directly to the buffer? And add a function to toggle the response.

Like the following example (Using snippets):

https://github.com/sourcegraph/sg.nvim/assets/101834410/1756aeff-eff0-4aba-82c3-494ccf5b56a3

This will give the feeling "AI is in your editor" feeling much better. (Especially with text models that generate gradually. Not in a ms like in the DEMO)

orhnk avatar Aug 23 '23 15:08 orhnk

@orhnk :CodyTask now works exactly how you proposed. You can use <CR> to accept and replace text in place.

manish-baghel avatar Mar 12 '24 18:03 manish-baghel