1. Topics
Old boy Education Daily-May 9, 2017-vim editor uses knowledge points:
Vim command paste with # or comment Information format will be confusing, what method to solve?
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.
2. Reference answer reason 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 vim indent function
Description: Then into the insert mode paste, the code will not be automatically indented, you can hit the code when you need to automatically indent, so you need to change back
: Set Nopaste #<--turn on vim indent function
A convenient way is to modify the. VIMRC configuration file in the user's home directory:
Set pastetoggle=<f9>
Description
Later in insert mode, you can quickly toggle Auto Indent mode by pressing the F9 key.
3. Statistical information
Today is the 46th Day of the day to accompany you and look forward to your progress .
For questions and answers, please leave a comment in the blog comments section .
Index of the topic of the previous period
http://lidao.blog.51cto.com/3388056/1914205
This article is from the "Lee blog" blog, make sure to keep this source http://lidao.blog.51cto.com/3388056/1923845
Old boy Education Daily-May 9, 2017-vim command paste with # or comment Information format What if there's a mess?