While googling “How to open my last edited file in Vim”, I found this excellent StackOverflow post.
It turns out that, in most Unix shells, you can suspend your current running process (Vim
in this case!) using
ctrl + z, putting in the background.
Then to recover the Vim session you can use
fg , which is a unix command
that continues a stopped job by running it in the foreground (fg) again.
Here it is in action!
vim random.txtto start the vim session
Ctrl + Zto suspend the vim session
$ fgto bring it back up