Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: New feature: Edit Prompt in editor #70

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

petertrotman
Copy link

@petertrotman petertrotman commented Apr 12, 2024

Hi,

I've made a bit of progress on this feature and I just wanted to get your opinion on whether it is useful enough to pursue and what you think of the code so far.

It is basically functional: When the user types /e or CTRL-E, the current prompt is copied to a tempfile and $EDITOR is launched to edit it there. Once finished, the updated prompt is copied back into the text area.

It doesn't do anything special with oatmeal.nvim so you end up with a second nvim window within nvim, which isn't ideal. I'm pretty sure the fix is to work out what the correct command is to send to the nvim socket and do that instead of lauching a new process, but I'd like to see what you think of this before taking it any further.

There are some tests and documentation is lacking but hopefully it's clear enough.

All the best,
Peter

@AlfreddGco
Copy link

Sounds good but don't you think a better flow would be to copy the last prompt into the current input box so that the user can edit in there and resend it?

@petertrotman
Copy link
Author

Sounds good but don't you think a better flow would be to copy the last prompt into the current input box so that the user can edit in there and resend it?

The idea is to be able to edit a large or complex prompt within your editor of choice, without using the editing features of textbox. I use it often on the command line (C-X C-E in zsh) and have found myself copying the prompt into neovim then back again to edit it in a way I am used to. This feature automates that process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants