Vim's shared system Clipboard and indentation related issues

Source: Internet
Author: User

Http://www.cnblogs.com/end/archive/2012/06/01/2531147.html


You can display the available registers, which note two special registers: "* and" +. These two registers are communicated with the system, the former relates the system selects the buffer, the latter relates the system Shearing board. They can be used to exchange data with other programs. If there is no "* or" + Register in the Register list, it may be caused by the lack of a graphical interface to install VIM. Debian/ubuntu can be resolved by installing the vim-gnome.

Sometimes you write code and find that when you paste the code in vim, the indentation is all messed up. Careful study of the following, the original is automatically indented for the sake of, so do the following settings:

Auto indent and Smart indent are canceled, so the paste will not go wrong. But in some vim does not work, or typesetting disorder.

Later found a better use of the settings:

After entering paste mode, you can paste the content in insert mode without any distortion. This is really gray often use, can't help but look at the help, found that it did so many things:

    • TextWidth set to 0
    • Wrapmargin set to 0
    • Set Noai
    • Set Nosi
    • Softtabstop set to 0
    • Revins Reset
    • Ruler Reset
    • Showmatch Reset
    • Formatoptions using null values

The following option values are not changed, but are disabled:

    • Lisp
    • indentexpr
    • Cindent

No wonder before only set Noai and Nosi not, originally with so many factors related!

But this is still more troublesome, each time to paste, the first set paste, and then paste, and then set Nopaste.

Vim's shared system Clipboard and indentation related issues

Related Article

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.