I had no idea how much better such an editing experience is until your video, and completely agree about the benefit of not having to context-switch a la git commit "interactive mode". The "inline typewriter" effect is also really cool
I can implement that specific case with a couple of lines in zsh. Something like:
autoload -Uz zed
icommit() {
() {
zed $1
git commit -F $1 # -a too, if you must ;)
} =(:) # Or maybe even =(< commit_template.txt)
}
Then icommit, via zed¹, will initiate an inline editor with all the power of ZLE available. Hit C-x C-w to write and commit, or C-c to abort. Obviously, you'd want some error checking and the like².Beauty of this basic implementation is that the keymap is fully controllable in zed as it is simply a new ZLE widget. It works with emacs or vi mode out of the box, and is fully customisable beyond that.
You could make the interface generic by writing your own ZLE widget, so that it can be called directly from within the line editor and remove the need for wrapping commands like I did above.
¹ https://github.com/zsh-users/zsh/blob/master/Functions/Misc/...
² This at least uses, and cleans up, a temp file to handle the commit message so it isn't completely useless.
Here's a video:
and the CVS repository for the Unix terminal IM client it is part of is at: It tracks and redraws your cursor when you move up and down between lines, and also pays attention to SIGWINCH to redraw things when the terminal size changes. I've never had the time to rewrite it in Rust, but I'd like to and then release it as a small library.It's always surprised me that nobody else has done this.