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.

1 Answer 1

9

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

M-x hide/show-comments-toggle

5
  • it's a very handy package. thanks for that. Commented Aug 11, 2015 at 8:28
  • Exactly what I wanted. Thank you :) Commented Aug 11, 2015 at 8:29
  • 1
    hide-comnt doesn't seem to be there anymore.
    – nroose
    Commented Apr 29, 2019 at 17:08
  • @nroose see the edit.
    – Name
    Commented Apr 30, 2019 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. Commented Jan 29, 2020 at 20:10

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