Comment-out or uncomment lines of code.
Wagner Luís de Araújo Menezes Macêdo
wagnerluis1982@gmail.com 2007
Pedro Vaz de Mello de Medeiros
pedrovmm@gmail.com 2007
Leonardo Ferreira Fontenelle
leonardof@gnome.org 2007, 2008
Vladimir Melo
vmelo@gnome.org 2008
Fabricio Godoy
skarllot@gmail.com 2008
Krix Apolinário
krixapolinario@gmail.com 2009
José Carlos Menezes
jcmenezes.91@gmail.com 2013
Enrico Nicoletto
hiko@duck.com 2013, 2014, 2022
Rafael Fontenelle
rafaelff@gnome.org 2013-2020
Bruno Lopes
brunolopesdsilv@gmail.com 2021.
Giovanni dos S.A.L Rodrigues
giovannilombone.io@gmail.com 2024

# Code Comment

The purpose of the Code Comment plugin is to disable or re-enable a portion of code. It inserts or removes the characters used for comments, depending on the language or syntax of the file.

First select some lines of code (or lines of text), then trigger the desired action (comment or uncomment) via one of these methods:

With the right-click menu in the main text area.

With keyboard shortcuts: Ctrl M for the comment action, and Ctrl Shift M for the uncomment action.

# Troubleshooting

If it doesn't work:

Make sure that the plugin is enabled by going to the Preferences dialog.

Check that the highlight mode (the syntax) for the document is correctly set and is not “Plain Text”. For plain text documents, the code comment plugin doesn't know what characters to insert or remove.

If it still doesn't work as intended, a more advanced technique is to look at the language definition files. From these files, the code comment plugin uses the `line-comment-start`, `block-comment-start` and `block-comment-end` metadata.