9

Is their a way to hide comment whatever the language used?

Like if I'm in cpp mode all /* ... */ should be hide and if I'm on LaTeX mode, all % ... will be hide.

9

The package hide-comnt available from Melpa (now marmalade) can do it:

M-x hide/show-comments-toggle

  • it's a very handy package. thanks for that. – yi.tang.uni Aug 11 '15 at 8:28
  • Exactly what I wanted. Thank you :) – Romain Picot Aug 11 '15 at 8:29
  • 1
    hide-comnt doesn't seem to be there anymore. – nroose Apr 29 '19 at 17:08
  • @nroose see the edit. – Name Apr 30 '19 at 5:27
  • There are a few packages out there that attempt this, but hide-comnt is the only one I see that actually makes comments appear to be removed rather than just blanking out the lines and leaving a bunch of unwanted whitespace. – Micah Elliott Jan 29 '20 at 20:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.