Hide comments in Notepad++
Solution 1
I came across the same problem some time ago. One thing you can do is put your comment lines between braces like:
{ //Hidden comments
//Word.Document doc = wordApp.Documents.Open(ref outputFile, ref nullobj, ref nullobj,
// ref nullobj, ref nullobj, ref nullobj,
// ref nullobj, ref nullobj, ref nullobj,
// ref nullobj, ref nullobj, ref nullobj,
// ref nullobj, ref nullobj, ref nullobj,ref nullobj);
}
So you can collapse it and see it this way:
{ //Hidden comments
Solution 2
In Notepad++, choose HTML from Language menu. And if you have comments like this:
<!-- here are some html comments
sdfasdfadsf
asdfasdf
-->
You will be able to fold them just fine. you can use Fold All to collapse the whole html content, and then start unfolding from there (to only parts that you want to see).
Solution 3
Workaround
Use alt+h to hide lines.
Fix
The following describes the setup of code-folding/comment-folding for in-line and multi-line comments on an existing language file using NPP.
**WARNING: Clicking the X at the top-right will close the document, so click Undock in step 4, to close the UDF dialog, not the X. You can recover a closed document in the File drop-down menu.
**WARNING: You may need to restart NPP to see the UDF in the Language drop-down menu; so, don't get flustered.
**WARNING: In step 4: I needed to clear the Open and Close texfields and then re-add the data before this worked.
- Click Language
->
Define your language... in the drop-down menus.
- Click Import..., as seen.
- Browse to User-Defined Language Files (docs.notepad-plus-plus.org) and find your UDF; as seen in the image above, PHP has not been contributed; however, JavaScript has been contributed, and it's much better than the built-in JavaScript Language file (I recommend trying that so click Okay).
- Under the Comment & Number tab, make sure the imported language is selected in the User language: drop-down menu. Also, make sure Allow folding of comments is checked. Single-line and in-line comments go under Comment line style and Multi-line comments go under Comment style; this way, if you do multiple single-line comments, they will fold.
Usage
alt + h may decrease horizontal scrolling by reducing line depth. alt + h maximizes editor-zooming FOV.
Code-folding improves editor-zooming FOV.
Non-hidden comments are unrelated items; hidden comments are code explanation.
finspin
Updated on August 09, 2022Comments
-
finspin over 1 year
I have an HTML file with quite many comments. They are useful but I'd like to hide them when I'm working with file to make it easier to read.
Have you come across a plugin that can do that? How about some other editor than Notepad++?