1

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?

  • 6
    It would be useful to give us more details on your use case and why you want :shell instead of :terminal. Maybe using CTRL-z to put neovim in background and then using fg to bring it back would be what you want? :h CTRL-Z – statox Apr 23 '19 at 7:14
1

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.

| improve this answer | |
  • There are no such commands in my (recent) neovim – ephemerr Apr 29 '19 at 5:13
  • My apologies, I forgot a very important ! in the commands! – padawin Apr 29 '19 at 7:50
  • thanks @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 Pill Oct 25 '19 at 8:00
  • :! will not work with interactive commands. The closest you will get to vim's :shell is probably using CTRL-z. – crater2150 Oct 25 '19 at 11:14
0

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 inscanse of vim and not in nested ones.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.