sábado, 2 de abril de 2016

TIL: 2 extra comment-dwim features

Today I just learned (by accident) a couple of tricks related to`comment-dwim'. The emacs command is bound to M-; , and it has different behaviours  depending on the line, region, and contents of the selection.

Appart from the ovbious behaviour we all know, today I found that:

  • Called with universal argument in an empty line, it adds ARG comment markers in the line. try C-u M-; in an empty line.
  • In a line with comments, c-u m-; removes the comments. that means deleting the comment, NOT UNCOMMENTING but removing all commentted text and the comment marker itself.

1 comentario:

Display name dijo...

Thanks for sharing that. Here's the function I've been using lately: https://gist.github.com/alphapapa/97642ff798f773f48af4dd5c20f4854f