Vim Paste Extra Indent problem

Source: Internet
Author: User

Fix an issue where pasting in Vi/vim will have a lot more indentation and whitespace at the beginning of the line SECURECRT will send your original text intact to the server as a string style. So when the vim on your server is set to Autoindent, in I mode, it will then indent the strings that are transmitted by SECURECRT. If you copy text that already has spaces or tabs that indicate indentation, they are also indented as strings.
Workaround:
1. Input before copying: Set paste (so that Vim does not start auto indent, but only copy-paste)
2. After the copy is complete, enter: Set Nopaste (Close paste)

Attached paste Knowledge
' Paste ' Boolean (default off)
Global
{Vi does not have this function}
Switch Vim to paste mode. Can be used to cut or copy text from a window and paste it into Vim. It
Use will avoid some unexpected effects.
Setting this option can be used for vim running on the terminal, where vim cannot distinguish between the input and the pasted text
This. In the GUI, Vim knows what comes from the paste, even if it does not open ' paste ' will basically not do
Wrong. This is true for Vim, which can handle mouse clicks on its own.
Resets this option when the GUI is started. So if you place it in the. VIMRC, you can make it in the terminal
Work, but not in the GUI. There are side effects of placing ' paste ' in the GUI: for example, paste
The toolbar button does not work in insert mode because it uses a map.
When the ' paste ' option is turned on (including when it is already open):
-Mask the mapping of Insert mode and command line mode
-Shielding Abbreviations
-' textwidth ' set to 0
-' Wrapmargin ' set to 0
-' autoindent ' is reset
-' smartindent ' is reset
-' softtabstop ' set to 0
-' Revins ' is reset
-' ruler ' is reset
-' Showmatch ' is reset
-' formatoptions ' is used as if it were empty
The following options keep the original values, but have no actual effect:
-' Lisp '
-' indentexpr '
-' cindent '
Note: When you open the ' paste ' option, if you start editing other files, the mode line or the automatic command can
Can change these settings again, causing trouble when pasting text. At this point, you may need to reset
Bit ' paste ' option.
When the ' paste ' option is reset, the options mentioned above are restored to the last ' paste '
Reset Reset ' paste ' before resetting ' paste ' has no effect. Because ' paste ' is activated without
With the ability to map, the ' pastetoggle ' option can be used to specify a hotkey to toggle the ' paste ' option.

Vim Paste Extra Indent problem

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.