Metagedit is a powerful Python-based plugin for the Gedit text editor that adds a flurry of additional features to the famed FOSS tool.

Although Gedit was replaced by the (GNOME) Text Editor app in Ubuntu 22.10 it remains available to install from the Ubuntu repos, and is still the default text editor in earlier versions, including Ubuntu 22.04 LTS.

And while Gedit is not everyone’s text editor of choice it has a solid feature set, is a native Linux app, and integrates perfectly with the GNOME desktop. For basic to intermediate needs like mine (I mainly edit .css, .js, and .php files) Gedit is everything I need.

But with Metagedit it can do a whole lot more.

Metagedit is Nitro Fuel for Gedit

Screenshot of the Gedit text editor with context menu and devious dialogs showing
An assortment of added value

This spotlight is about MetaGedit and the features the plugin brings to Gedit. I do not claim that anything mentioned is new/unique/exclusive/can’t be found in other text editors. And while it’s easy to say “if you want X, use Y instead” swapping an entire app for a small thing is not a practical suggestion for those who want to use Gedit.

So what does it offer?

For one, better encoding utilities. With Metagedit installed and enabled Gedit is better able to auto-detect the correct encoding of a document, relays encoding in the status bar, and provides a handy manual encoding override through a right-click context menu that — this is neat — offers you a real-time preview of the effects.

The plugin adds line operations, including removing empty lines, sorting, deduplicating, reversing and shuffling, and joining operations, to context menu. These work on selected text or, if no text is selected, the entire document.

Ever opened a file to edit and only realised you need to be root to modify it when you attempt to save the changes? Metagedit adds an ‘Open as Administrator’ option to the overflow menu, making it a fraction faster to edit protected files.

There’s also a broader set of key combos, including a keyboard shortcut to delete the current/selected line (ctrl + e), and a well designed colour picker tool is included. This latter feature may seem odd but it proves real handy when editing .css as it lets you pick any colour on screen and insert the HEX, RGBA, or CMYK value.

Other Metagedit offers:

  • Dark theme toggle (app specific setting)
  • Document Statistics dialog
  • Enable/disable overlay scrollbars
  • Context menu option to remove trailing spaces
  • Optional bottom margin to Gedit view
  • Save and load Gedit tab sessions, incl. auto-restore on open
  • Smart Home/End/Backspace

I think I’ve covered everything, there.

Want to try it out?

Thankfully Metagedit is simple to install on Ubuntu.

There’s no PPA, and no .deb installer. Instead, you download the plugin source code from GitHub, unzip, then run the install.sh script inside. This script installs everything needed to build the plugin, then builds it, and installs it into the correct directory.

Once installed, relaunch Gedit, head to the Preferences > Plugins panel, and check the box next to Metagedit. It enables instantly, ready for you to explore all of its nifty enhancements.

h/t Pedro

gedit Text Editor