đź“… May 22, 2015
Gedit is an excellent text editor that supports themes and plugins. One such plugin useful for programming is called Code Comment, and it allows you to comment and uncomment highlighted lines of code at once.
Install
The Code Comment plugin is available from the Ubuntu repository as part of a bundle of additional gedit plugins. Assuming that gedit is already installed on your Linux system, install the gedit-plugins package from Synaptic or the command line.
sudo apt-get update sudo apt-get install gedit-plugins
Close and restart gedit (if open) and go to Edit > Preferences > Plugins tab. You will see many new plugins added to the default list.
A list of all available plugins will appear. A plugin must be enabled in gedit before use. Scroll down to find Code Comment and check its checkbox. Close, and Code Comment will be available for use from gedit’s Edit menu.

Gedit plugin list from Edit > Preferences > Plugins tab. Highlighted is the Code Comment plugin. Check it to enable.
Usage
To comment, highlight a block of code and choose Edit > Comment Code. The selected code will be commented with line-level comments, not block-level comments.

Now, select Comment Code from the Edit menu. HTML comments are applied. To uncomment, highlight the lines and choose Uncomment Code from the Edit menu.
Comments are language-dependent. For example, HTML comments (<!– –>) will be used in HTML files, Python comments (#) will be used in Python codes, and JavScript single-line comments (//) will be used in JavaScript files.

Highlight and comment. It’s that simple. Notice that gedit automatically inserts the correct comment characters depending upon the detected source code. Since this source file is Python, Python comment characters are used. Even comments are commented further.
Keyboard shortcuts are also available:
-
Ctrl + M Comment Code
-
Shift + Ctrl + M Uncomment Code
This is a useful gedit plugin that is worth experimenting with.