Code comment

Code comments are portions of text that make it easier for people to understand a program's code, but they don't affect how a program works. Comments are separated from other parts of a program by special characters.

The code comment plugin makes it easier to quickly create or remove code comments.

To enable the plugin:

  1. Press the menu button in the top-right corner of the window and select Preferences ▸ Plugins.

  2. Select Code comment to enable the plugin.

To create or remove a comment:

  1. Highlight the portion of text where you want to add or remove a comment.

  2. To add a comment, right click and select Comment Code, or press Ctrl+M.

  3. To remove a comment, right click and select Uncomment Code, or press Shift+Ctrl+M.

gedit will automatically use the correct style of comment based on the language or syntax of the file. If gedit doesn't identify your language or syntax, you can select it from the language list in the bottom Status bar.