I know that, while in Vim (and Vi, too, I think), if I want to temporarily access the shell I can do one of several things:
:shell), then log out from the shell to return to Vim
:stop), then use
fgto return to Vim
:! <command>to pass commands through Vim to the shell
:mksession <filename>to save a session, quit Vim, then restore the session with
:source <filename>after returning to Vim (admittedly this is probably too cumbersome for most "temporary" shell access needs)
- Use windowing software such as screen, tmux, etc.
My question is, what are the technical and practical differences of the first two options—using
:sh vs. using
:sus? In the Vim help pages, it looks like the only difference is that with
:sus, you either automatically write out the buffer (if 'autowrite' is set) or you risk losing your edited buffers if you never return to Vim, whereas with
:sh you have no choice but to return to your Vim session when you exit the shell.
Are there any other differences, either technically (such as memory and processor use) or productivity-related reasons why a Vim user might choose one method over the other in different situations?