Thank you for the article of the Ox. It solves the problem that I have a headache with vim. When VIM creates a new file, the sticky code is automatically indented, resulting in a very confusing format. According to Blogger's experience, in/etc/vim, modify VIMRC, add set pastetoggle=<f9> before pasting code, enter insert mode, press F9, you can turn off automatic indentation. When you need your own handwriting code, enter insert mode, the default is automatically indented. ===== VIM The format is broken when the copy code contains comments
Each time you copy code, if the code has//such comments can easily let the format out of chaos, through the following settings to avoid this situation.
Cancel automatic indentation when pasting codeVim automatically indents the code when it is pasted, make a mess of the code, maybe even because a comment on a line caused by the following code is all commented out, I know there are students this time will use VI to open the file and paste it up (this is what I used to be), in fact, need to set up first Set paste Then go into insert mode and paste, the code will not be automatically indented. But when you need to automatically indent code, you have to change back: Set Nopaste The easiest way to do this is to add a sentence to the. VIMRC: set pastetoggle=<f9> Later in the Insert mode, you can toggle the automatic indentation by pressing the F9 key. |
Http://hi.baidu.com/hellosim/blog/item/a7b165151089fae8c3ce798b.html