Vim restore shell on exit

I just installed Arch on my new computer and I can’t figure out which command I need to add to .vimrc so that it can restore the contents of the shell (before calling vim) on exit.

That is, I want my shell to look like this:

# whoami root # who root tty1 2011-12-11 16:42 # vim somefile.txt # 

But instead, it looks something like this:

 1 hello 2 how is it going? ~ ~ ~ ~ ~ ~ ~ ~ # 
+4
source share
2 answers

Actually, he cannot do this if your terminal does not support an alternative screen. And for those who do (xterm, gnome-terminal), I believe vim does this automatically (the corresponding restorescreen ).

+1
source

Source: https://habr.com/ru/post/1386191/


All Articles