Geany – A Perfect Web Development IDE

One of my favourite editor is Editplus. I have really liked this editor over the years because it is simple, lightweight, custom code completion is very easy to setup and you can modify remote files without having to upload / download through FTP.

Since moving to Linux, I’ve been looking for an alternative. I wanted it to be light-weight, easy code completion and remote file editing. I found many choices in the Linux world and majority of them open source. I tried gedit, kate, Quanta, Eclipse, gPHPEdit, BlueFish and Geany. All of these have their advantages and disadvantages and someone is bound to like one over the other. I won’t go into reviewing all of them and would suggest to try them out yourself. I preferred gedit and geany over the others.

gedit

gedit is fast and it does pretty much everything you want from an editor. It lets you edit remote files without any hassle. It is also a default text editor on many Linux distributions. I found a lot of problems with Code Completion. gedit auto complete files in XML format e.g. in /usr/share/gedit-2/plugins/snippets/html.xml is the snippets file for HTML. It was not an easy job converting my current snippets into an XML type. The following code is an example of what you would need in there to auto complete “br” tag.

 

<snippet>
    <text><![CDATA[<${1:tag}>$0</$1>]]></text>
    <tag>&lt;</tag>
    <description>SGML tag</description>
  </snippet>

After spending over an hour setting up the XML snippet for HTML, CSS and PHP, I found that if you try to autocomplete PHP code when you have a HTML file open it would not work. So I merged the 3 xml files into /usr/share/gedit-2/plugins/snippets/global.xml. Adding autocomplete code in this file will work for any file type including unsaved and empty files.

So I migrated my autocomplete file from Editplus format to gedit xml file. After all the tedious work, I found that the auto complete would not always work and it was unreliable. I had to restart gedit many times to get it working.

Geany

This is one the the best editors out there, The more i used it the more i liked it. It is a very light-weight with many plugins and features.

It auto completes XML/HTML tags by default. In preferences > editor > completion, you can auto-close quotes and brackets:

Brackets ()

Curly brackets {}

Square brackets []

Single quotes ''

Double quotes ""

To add custom snippets, go to tools > configuration files > snippets.conf and it will open in another tab. This is the only file you need to modify for all your needs, the snippets are added into different sections. Anything under [default] will work on any file type and adding code in [PHP] section will work for php files only.

Here is an example adding br tag to autocomplete for HTML files:

[Default]

[PHP]

[HTML]

br=<br />

How easy was that? The word before the “=” sign is what you will type and on pressing “tab”, everything after the “=” sign is what will be replaced with. Save and test it out in a new document. This is alot similar to Editplus and easier than gedit xml.

At present, there is no direct FTP support in Geany and there is no plug-in available. For linux users there is a way, if you go to tools > plugins manager > Tick File Browser and click on View > Tick “Show Sidebar. On the sidebar, click on “Files” and navigate to “yourhomedirectory. Right click and Tick “Show Hidden Files” and navigate to “.gvfs” directory which will show your ftp folder. You can now modify remote files locally.

I found this is a perfect alternative to Editplus and even better. It works on many platforms and its FREE. For Linux its easy download from Software Packages such as Ubuntu Software Centre and for windows Download Here.

Download Geany snippets and extras.

Leave a Reply

Your email address will not be published. Required fields are marked *