Every GNU/Linux user must be knowing about Gedit. This tiny text editor which comes with gnome is much more powerful than we all think. A few customizations and adding a few plugins will convert this simple text editor into a complete IDE for any programming language. In this article, i have mentioned about the configurations i have made in my box and the plugins which you might find useful.
Any text editor has to be customized according to the need of the end user. The customizations for a C or C++ coder and a PHP or Python coder are totally different. So let me write here according to various needs. Check out in which category you fit in and use those customizations.
The Preferences window in Gedit is the core which converts this simple text editor into a complete IDE. It has features to customize almost everything.
Open Preferences Window (Edit -> Preferences)
In the View Tab
- Check Enable text wrapping.
I prefer to see the long lines in the same window, which reduces the pain of scrolling across the window using the mouse.
- Check Display line numbers.
- Check Highlight current line
In my Ubuntu Studio theme, it wasn’t easy to read when the current line is highlighted. So i disabled this in that theme. So check this whether this suits your gnome theme when you enable this.
- Highlight matching bracket
An useful option if you are used to getting confused with brackets.
In the Editor Tab
- Set the Tab width as 4
- Check Enable automatic indentation
- Uncheck Create a backup copy of files before saving
Again this depends upon your need. Backup files are created by adding a ‘~’ to the current file name. If you are a web developer and coding in any web development language, better don’t enable this option. Many times these ‘~’ files created might create a security hole in your server. For example, mysql_connect.php file will have a backup called mysql_connect.php~ and your web server will parse the mysql_connect.php but it won’t do the same for the backup file. It’ll just display the source code to the client and thereby your your mysql password is gone 😛
- Check Autosave files every 5 minutes and make that 2 mins
If you don’t have the habit of saving the file often, then this might save you when something terrible happens 😛
In the Font & Colors Tab
- Uncheck the Use the system fixed width font
- Set the size of the editor font as 10 or 12
- Choose any one font from the following. Note that Mono space 10 is the system fixed with font.
Standars Symbols L
- I prefer the Classic color scheme. Just three more clicks, you can see all the color scheme and choose anything you like.
In the Plugins Tab
This sections makes the gedit a really powerful text editor. By default gedit comes with few standard plugins but you can install more plugins by installing the gedit-plugins package. If you don’t have root access, download the plugins from gedit.org and copy it to your ~/.gnome2/gedit/plugins folder. You can continue if you are lazy to download the plugins now. You can do that when a need arises. 😉
After this jump to section which you might be interested in.
- Bracket Completion ( You need to install this plugin)
A plugin which automatically adds closing brackets, single quotes and double quotes. Sometimes really useful and sometimes irritating. When you are typing the code, this is pretty useful but when you are editing a code already written, then this irritates you by adding closing brackets or quotes where you never intended to add.
- Code Comment ( You need to install this plugin)
A useful plugin for any programmer. You can comment or uncomment a selected block of code.
- Indent Lines
Very useful when you are specific about the indentation rules. Indents or un-indents a selected block of code. Very useful for python.
Want to insert a piece of code which just a few keystrokes, then this is for you. Yes lesser keystrokes than Ctrl C Ctrl V.
- External Tools
This gives amazing power to manipulate anything within gedit. I guess i can’t write about this here. Check out this post about External Tools. And don’t skip that post. It’s the BEST plugin for gedit.
Download the HTML tidy plugin from here and extract the folder to your ~/.gnome2/gedit/plugins folder. Enable the HTML Tidy plugin from the plugins tab in Preferences Window. HTML Tidy is an utility to clean up and pretty print HTML/XHTML/XML. Enable the Bottom Pane from the View Menu and you can clean up or check any HTML/XHTML/XML document.
The default configurations are enough to use Tidy. If you want to tweak it according to your needs, then Configure Plugin ( There are so many options 😛 )
This is an useful plugin once you know what gives what. If you code for online programming contests like spoj, topcoder, acm or usaco and if your programming language is C++, then download this cpp.xml file and put it in your ~/.gnome2/gedit/snippets folder. Then press template[tab] or topcoder[tab] in a new cpp file.
Apart from that, if you are a web developer, then check out the Snippets for HTML and PHP. Once you remember the shortcuts which you need, they’ll make your life really easy.