Resume terminal content after vim exits

Source: Internet
Author: User
After vim exits, terminal content is restored. some terminals can be restored to the status of the terminal before vim is enabled after vim exits, similar to the following: www.2cto.com $ vim/etc/sysconfig/#### open vim ##### sdskk here. some file contents: q $ vim/etc/sysconfig /...
After vim exits, terminal content is restored. some terminals can be restored to the status of the terminal before vim is enabled after vim exits, similar to the following: www.2cto.com $ vim/etc/sysconfig/#### open vim ##### sdskk here, some file content: q $ vim/etc/sysconfig/# The Terminal restores to the previous status but some of them do not work. to solve this problem, follow these two steps: 1. set the TERM environment variable to xterm or xterm-color, you can. add: export TERM = xterm-color 2 to the bashrc file, set the values of the t_ti and t_te variables of vim (optional, for example, not required on centos), and use vim to open a file at www.2cto.com, in normal mode, enter: set t_ti or: set t_te. if the value is similar to: "^ [[? 1049 h "and" ^ [[? 1049l ", then you need to add the following lines in. vimrc: if & term = ~ "Xterm" "SecureCRT versions prior to 6.1.x do not support 4-digit DECSET" let & t_ti = "\ [? 1049 h "" let & t_te = "\ [? 1049l "" Use 2-digit DECSET instead let & t_ti = "\ [? 47 h "let & t_te = "\ [? 47l "endif

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.