1

Either quitting vim or ctrl-z vim, should display the content and not display the previous commands in xterm.

I am pretty sure it's a vimrc setting and not Xresources setting but can't remember...

Thanks.

2
  • What content are you referring to? Why do you think that it should display the file that you were previously editing in vim? You are exiting out of the application and returning to the state of your shell prior to starting vim. – Kevin Bowen Apr 9 '13 at 2:07
  • I meant to say show the content of vim. Rather than clear the screen. I will check tomorrow if I can find it. – Marin Apr 9 '13 at 2:28
1

in vim typing :help norestorescreen says to put the following in your .vimrc:

    For non-Windows Vim: You can set or reset the 't_ti' and 't_te'
    options in your .vimrc.  To disable restoring:
            set t_ti= t_te=

This worked for me using Ubuntu 12.04 with Vim 7.3.429.

0
if &term =~ "xterm"
 " restore screen after quitting
   set t_ti=ESC7ESC[rESC[?47h t_te=ESC[?47lESC8
  if has("terminfo")
  let &t_Sf="\ESC[3%p1%dm"
  let &t_Sb="\ESC[4%p1%dm"
  else
  let &t_Sf="\ESC[3%dm"
  let &t_Sb="\ESC[4%dm"
 endif
endif

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.