linux-vim File Editing exception problem handling
Problem Description:
Each time the code is copied, if the code contains//or # Such comments are easy to let the format out of order, the content displayed is not neat, not the desired display format.
cause Analysis:
is due to the automatic indentation of the vim Edit command, so you can suppress automatic indentation when pasting code with comments
Problem Solving:
Vim is automatically indented when pasting the code, making the code mess, and maybe even because a comment on a line causes the code to be commented out, the initial solution is: Use VI to open the file and paste it up, but in fact, the Vim editor can be set to modify.
Vim oldboy.txt #<--Edit a file: Set paste #<--in Vim's command line mode input, turn off the vim Indent function Description: Then in insert mode paste, the code will not be automatically Indentation, you can tap the code when you need to automatically indent, so you need to change back: Set Nopaste #<--to open the Vim indentation function # The convenient way is to modify the user home directory. VIMRC Profile: Set Pastet Oggle=<f9> Description: In the future in insert mode, just press the F9 key to quickly switch to Automatic indentation mode
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/8F/5A/wKioL1jbp9LRTuiLAAAXhNDRN18089.png "title=" logo-Blog Watermark Information 02.png "alt=" Wkiol1jbp9lrtuilaaaxhndrn18089.png "/>
This article is from the "Hq_oldboy" blog, make sure to keep this source http://heqoldboy.blog.51cto.com/12763466/1911542
Linux-vim file editing commands tips