How to format the de-line number and code of notepad +

Source: Internet
Author: User

Notepad ++ several methods to remove code row numbers

(From: http://hi.baidu.com/beer_zh/item/e70119309ee587f2a8842892)
Q: When I copy code on a webpage, I often encounter a highlighted program automatically adding a line number or character "#" to the code. How can I format it? As follows:
#1 // remove the first character or line number #2 <? PHP #100 echo 'wait a bit longer ';#...... ...... #2010 echo 'speechless '; #2012?> ========================================================== ========================================================== ======
Solution 1: manually delete only 2012 rows ~~~ Not much.
Solution 2: Open notepad ++, hold down ALT, and drag out the selection box with the mouse. This is the column selection method, which is quite helpful;
Solution 3: Regular Expressions (this is another omnipotent thing ).
Open notepad ++, CTRL + H, [search Target], enter the following regular expression [search mode], select the regular expression, and then Alt +!
# + Space + row number \ s \ D +
Row number + space ^ [0-9] +
Row number +. + space \ s * \ D * \. \ s
Solution 4: Use the textfx Tool
Open notepad ++, [select all code]-click [textfx]-[textfx tools]-[Delete line numbers or first word] In the toolbar, OK!
How to add a row number: [select all codes]-click [textfx]-[textfx tools]-[insert line numbers] OK in the toolbar!
Solution 5: Write macro commands
Open notepad ++, ALT + O, select macro, and start recording: (initial cursor in the beginning) Note: All keyboard operations
Macro process: [HOME key]-[Ctrl + Shift + direction key * right]-[backspace]-[direction key *]
Definition: cursor top grid-select by word field-Delete the first row-Next row // The second step is operated n times according to the situation.
The above is the method I used in NP ++. Other Editors Should Have solutions. Please share them!
PS: When copying code, check if the website has a [Copy button] To avoid copying it to the row number!

Code formatting:

(From http://blog.csdn.net/JGood/article/details/5310194)

Nppastyle is a notepad ++ plug-in used to format C, C ++, C #, and Java code edited in notepad. Nppastyle uses astyle internally to format the code. It is a very simple but practical notepad ++ plug-in. You can download this plug-in http://code.google.com/p/nppastyle/ here. Http://code.google.com/p/nppastyle/

Below are some plug-ins:

(1)

(2)

(3)

(4)

 

Note: notepad ++ is a powerful text editing tool. It is free, open source, and fast. It is an excellent alternative to billing tools such as ultraeditor, emeditor, and editorplus. I remember that many people refused to use this tool because the notepad ++ authors resisted the Beijing Olympic Games. I personally think we should look at it rationally. I personally do not approve of the Olympic Games, at the same time, I hate Chin ese ZF's "getting" policy.

At present, notepad ++ has done well, but there are no plug-ins similar to project management. If I have time, I hope I can write such a plug-in myself.

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.