Hacker News new | past | comments | ask | show | jobs | submit login

> One use case for the new remote functionality is the ability to open files from the embedded terminal emulator in the primary Neovim instance, rather than creating an embedded Neovim instance running inside Neovim itself.

Hmm, if I type "git commit" within the terminal, is there some value of $EDITOR that would make it launch a buffer to edit the commit message, then finish when I close the buffer? (and if so, are there distinguishable success vs failure ways to close the buffer?) That's my biggest editor-within-an-editor moment.




For that to work, you'll need the 'wait' versions of the remote flags. Those are still being worked on in a PR, but I'm hoping to finish them up by the next release: https://github.com/neovim/neovim/pull/17856

That said, this sort of remote opening has been possible in Neovim since the client-server stuff was added in the early days. This is only adding the remote editing flags and implementation to Neovim itself to make it easier.

Neovim-remote(https://github.com/mhinz/neovim-remote#typical-use-cases) is an outside-of-Neovim way to do it with the Python client. It has an $EDITOR setting listed there. Or if you don't want to use Python, you can use invim(https://github.com/groves/invim#to-use-as-your-git-commit-me...). It's just a shell script. Or you can wait for the next release!


I'm not sure if I understand you, but with EDITOR=nvim it'll do just that. To "commit" w/ the message you have in editor, ZZ. To abort, use :cq


That's a separate nvim instance within the terminal of the outer nvim instance. If I'm understanding this feature correctly, the idea is that instead of that, you make the outer nvim instance do stuff. Then pasting back and forth between buffers works better, etc. It wasn't clear to me from this short blurb though if that includes blocking for the buffer to be handled and then signalling success or failure to the caller. (or for that matter if I'll remember the mechanism for it if there is one. I operate on muscle memory and might just stick with the tiny editor within the bigger one. But I'm curious anyway.)


It would be nice if it overrode EDITOR with some command that opened a new pane in your existing Nvim session. That seems doable.

Alternatively, Tim Pope's fugitive is pretty great and you can write :Git commit and it does just that.


It could even overlay the terminal pane for the duration of the command with the buffer pane. So it'd look a lot like opening the second editor instance, except incorporated with the first editor's buffer list, registers, etc.


Oh, I see. I got derailed by the usage of terminal to refer to three different things :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: