Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to uncomment blocks code in emacs

Tags:

comments

emacs

I am using emacs with the major mode "Java/L Abbrev" activated. When I type M-x comment-region or M-x uncomment-region the desired effects happen in the editor. But I am getting tired of typing this out every time.

I have found that I can type C-c C-c and comment a region. I want to find a similiar way to uncomment a region. I go to the emacs docs:

https://www.gnu.org/software/emacs/manual/html_node/ccmode/Comment-Commands.html

And it says to give the C-c C-c command a negative argument to uncomment lines. How do I do this? or is there a better way?

like image 672
S French Avatar asked Aug 08 '18 17:08

S French


Video Answer


1 Answers

Please try M-;, which is bound by default to comment-dwim. I think this should do what you want.

like image 147
varro Avatar answered Sep 17 '22 15:09

varro