📅 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.
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.
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.
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.