In reading other people's code occasionally encounter format is very messy, read very laborious situation, if manual change, very error-prone and time-consuming, then can use some professional editor to format the code, notepad++ is a lightweight code editor, taking up less memory, running fast, but NotePad + + itself is not with this formatting feature, but he supports the Nppastyle plugin to complete the formatting.
- Install notepad++, install package download: Http://rj.baidu.com/soft/detail/13478.html?ald
- Download the auto-format plugin:NppAStyle.dll , you can select a plugin-->pligin manager-->show Plugin manager--> Install Nppastyle plug-in in Notepad. You can also download the Nppastyle plugin directly, Link: http://pan.baidu.com/s/1kTzcQV1
- Then find the installation directory of the notepad++ you installed (the simplest way is to click "Open File Location" in the properties of the notepad++ shortcut you are using). After entering, we open the Plugins folder and copy the NppAStyle.dll just extracted here.
- Restart notepad++, the Nppastyle option appears in the Plugin menu bar
2. Configure Nppastyle.
Click "Plugins" in the menu bar---> "nppastyle"---> "options" to choose the right style in your code style, such as Java, or Stroustrup
Open the messy code, use the alt+f key to format ,
Before format
After formatting:
Partly reproduced in Worldsing's blog, http://www.cnblogs.com/worldsing/p/4174191.html
How to format code in notepad++