I think the killer feature here is not just terminal-in-vim, but the full emulation aspect. When I used to use Emacs extensively, I could never really get into eshell because it ignored terminal emulation. It was OK for some things, but mostly just threw a wrench in my normal shell workflows.
Of course, if you use Vim, this looks great too! I just don't want anyone to be dissuaded from Emacs for this reason ;)
But honestly, even though I've kept this installed, it still feels foreign enough that I usually just run gdb (or cgdb) in a separate terminal anyway. If I ever make the jump to neovim, I'll be curious to see how much of a native feel can be given to things like this.
Is there a mode (planned) that would have local line editing? Something like having a buffer where you can compose your line and then send it to running program. Or can you do that already?
[editeditedit]; # <--- on an empty line
<command-mode on your crafted line> 0"ay$ ;# go to start of line, in a buffer named "a" yank to EOL
@a ;# <-- execute the buffer "a"
Example line:
:r!ls -ld <splat>^M
^-- enter ed mode, read contents of command "ls -ld <splat>"[enter]
Is that close (or adaptable?) to what you're thinking of?
EDIT: Test in vim (it works) and change the "[shift 8]" to <splat> (HN html renderer was swallowing the "[shift 8]")
(Which is not a complaint; I'm pretty okay with curl | sudo sh, because I'm okay with so many other equivalent things, like this.)
* :term [prog/args] will open a new special buffer "connected" to a pseudo terminal running prog/args
* any command that would enter insert mode will focus the terminal buffer instead.
* when focused a new mode is entered where all keys are passed directly to the program. The <c-g><esc> combination will return to normal mode.
* new terminal-only mappings can be added with the "t" prefix(eg: tnoremap <c-a> <c-g><esc> exit terminal focus using ctrl+a)
Someone asked: "I really don't know how I would use this feature but it's impressive how well it works."
tarruda replies: "With time, the numerous use cases for this feature will be clear, but here's one idea: This allows another level of integration between text mode programs and Neovim. For example, we'll be able to make gdb respond to nvim mappings and change file/line numbers when a breakpoint is hit(Technically this might be possible with tmux but not without numerous hacks)"
If you want to try this out yourself and have installed neovim with brew, do this:
At the top of the recipe, change the head: And then: