Magazine

10 Improvements to Gedit’s Effectiveness as a Code Editor

Posted on the 07 April 2023 by Top10

GNOME may have ditched Gedit as the default text editor, but it's still loved by longtime Linux users.

It's primarily a text editor, but with a few tweaks it can work as a lightweight code editor.

Yes, there is no need to use VS Code or other specialized code editors to write Bash scripts or simple programs in other languages ​​anymore when Gedit is available.

1. Install plugins

Few people don't even know that Gedit has a plugin installation feature. You can install plugins to get more features.

There are two types of plugins:

  • Official Gedit plugins that are available from the editor menu.
  • Third party plugins that can be downloaded from the project websites and placed in the plugins directory (described below).

Gedit plugins can be located in /usr/share/gedit/plugins or ~/.local/share/gedit/plugins.

Available and installed plugins can be accessed by clicking on the Hamburger menu and then opening the Preference window,

In the Options window there is a Plugins tab where you can see all the plugins available to you. You can use checkboxes to enable and disable plugins.

2. Show file browser in sidebar

If you're working on a project that has multiple files and folders, it's very useful to have the File Browser display all available files in the sidebar.

Go to Settings -> Plugins and enable the file browser panel.

After that, click on the menu in the upper right corner and turn on the sidebar view in the menu View -> Sidebar.

Now change the sidebar view to File Browser if it hasn't already been done.

3. Embed terminal

Yes! You can embed a terminal directly into the Gedit text editor.

What's the point? Well, if you write programs or scripts, the built-in terminal will help you run the script and check the changes in the code right in the editor.

To get this, first install the plugin (for Ubuntu):

sudo apt install gedit-plugin-terminal

After installing the plugin, enable it in the Settings->Plugin menu.

Enable Bottom Bar from Menu -> View -> Bottom Bar

4. Markdown Preview

There are several Markdown editors available for Linux, but you don't have to install another application to use Markdown.

With a plugin, unsurprisingly called Gedit Markdown Preview Gedit does a great job of displaying Markdown code.

Arch users can find it in the AUR as the gedit-plugin-markdown_preview package.

Other Linux users can find installation instructions at project web page.

Once installed, enable it in plugins. You must enable the sidebar view from the menu -> View > Sidebar

This causes the Markdown text rendering to appear in the sidebar or bottom bar.

5. Create snippets

Good encoders encode. The best coders reuse them.

If you often use the same piece of code or text, you can save it as a snippet and paste it when needed. This will save you time (and frustration).

First enable the Snippet plugin.

You can now access snippets from the menu -> Manage Snippets

You will find that it has already added several snippets for various programming languages.

You can also add your snippets to the desired folder by clicking on the + sign at the bottom left. You can also assign a shortcut key to snippets to paste them even faster.

6. Fix the dark mode issue

Coders love dark mode. Gedit sticks to the system theme, and if you switch to dark mode at the OS level, it also switches to dark mode.

The main problem is that you can't read anything on the currently selected line because both the text and the line selection are colored white.

It's impossible to fix this. However, as a workaround, you can either disable highlighting of the current line or use a different color scheme. I prefer to choose a different color scheme.

Go to Options -> Font & Colors and choose a dark color scheme like Oblivion. This will change the color scheme a bit, but at least you will be able to see the text on the highlighted lines.

7. Quick selection of selected text

Double-click on a word and Gedit will highlight all occurrences of that word throughout the document.

This feature is not enabled by default, although there is an official plugin.

Go to Settings -> Plugins and enable the Quick Selection option.

8. Show Line Numbers

Many code editors show line numbers by default. This helps you quickly jump to the right line when you see "syntax error on line X".

You can enable the display of line numbers by going to Options -> View -> Show line numbers:

You can also turn it on or off from below.

9. Save Version

If you're modifying a file, perhaps it's best to create a backup? Gedit can do this automatically.

Enable this feature in Settings -> Editor -> Back Up.

A backup file will appear with the name of the original file appended with ~.

10. Autosave files

While we're on the topic of versions and backups, how about turning on autosave in Gedit? Thus, if you are working on a document and forget to manually save it with Ctrl+S, the changes will be saved automatically.

Note. This feature does NOT work on a brand new document that has never been saved to disk.

In the menu Options -> Editor you can enable the autosave feature. By default, autosave occurs every 10 minutes, but you can change the duration to your liking.

There is also a third-party smart-auto-save extension that automatically saves a document as soon as you stop typing it.

2722400cookie-check10 performance improvements for Gedit as a code editorno

Similar

Инструкции,Программы,Gedit,gnome,linux
#Improvements #Gedits #Effectiveness #Code #Editor


Back to Featured Articles on Logo Paperblog