Often I jump from Vim -> Command Line by backgrounding Vim with Ctrl-Z
, doing my CLI stuff, and then going back to Vim with vi
(which is just aliased to vim
).
Sometimes though, I'll forget about my backgrounded Vim, and end up having another Vim process running.
How can I make my vi
alias work such that:
- if there is a Vim process backgrounded, just foreground into that
- if there is not, load up
vim
as normal.
Thanks in advance!