How to configure secureCRT to remove content display after quit from vim

Posted on

Problem :

Open a ssh or telnet connection in secureCRT 6.0 or 7.0, when “vim xxx.txt”, after quit vim by “:q”, the content of xxx.txt will still be visible in screen. But in putty, the same operation, content of xxx.txt will be disappear. How to configure secureCRT to be like putty?

Solution :

According to this post, adding the following code into .vimrc works for me:

if &term =~ "xterm"
    " SecureCRT versions prior to 6.1.x do not support 4-digit DECSET
    "     let &t_ti = "<Esc>[?1049h"
    "     let &t_te = "<Esc>[?1049l"
    " Use 2-digit DECSET instead
    let &t_ti = "<Esc>[?47h"
    let &t_te = "<Esc>[?47l"
endif

For more information regarding the two variables ti and te, you can refer to :help xterm-screens in Vim

Leave a Reply

Your email address will not be published. Required fields are marked *