* :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:
brew tap neovim/homebrew-neovim
brew edit neovim
At the top of the recipe, change the head:
#head "https://github.com/neovim/neovim.git"
head "https://github.com/tarruda/neovim.git", :branch => "builtin-terminal-emulation"
This promises to be incredible for all of the use cases where folks currently remote-control tmux windows, etc.
When considering things like debugger integration, this cracks the door to some features previously owned well only by GUI IDEs.
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.
To note: Emacs supports full terminal emulation too, with `ansi-term`. It's a little janky switching between line/char mode, but I use it as my default terminal.
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.
> 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.
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?
* :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: