There is no :shell
command in neovim.
:terminal
opens a shell without previous output, while :shell
contains all the output of the parent shell and all previous shells. Is there any way to emulate :shell
behavior with :term
?
2 Answers
As @statox mentioned, you can use CTRL-z
. If you want to spawn a new shell from vim, as :shell
does, you can do: :!sh
, :!bash
, :!zsh
(pick your favourite), which has pretty much the same effect as :shell
.
-
1thanks @padawin - but when I enter
:!sh
in nvim I just see "Press ENTER or type command to continue" in the status line, but not the interactive shell I get when entering:shell
in vim (or also:!sh
). Any ideas?– Red PillOct 25, 2019 at 8:00 -
1
:!
will not work with interactive commands. The closest you will get to vim's:shell
is probably usingCTRL-z
. Oct 25, 2019 at 11:14
My solution for this need of shell integration is to use neovim terminal tab as main shell.
I use also skywind3000/vim-terminal-help plugin and drop
command to open new files in same instance of vim and not in nested ones.
:shell
instead of:terminal
. Maybe usingCTRL-z
to put neovim in background and then usingfg
to bring it back would be what you want?:h CTRL-Z