13 April 2012

Geany: open-source SublimeText for front-end developer

When I started doing JavaScript, I kept searching for an ideal JS code editor that is free, lightweight and fast just like FlashDevelop, my favorite ActionScript counter part. (In case you're wondering, I have made a Wine mod of FD4 and been able to run it on Linux). Most JS editors I tried were Java-based, heavy and code assistance is as not good as I expected.

Then I discovered SublimeText 2 and Geany. The former is commercial and the latter is opensource. Both of them are cross platform, lightweight, fast and has syntax highlighting for quite a number languages. For JavaScript and front-end stuff in particular, they both have some support for code hinting and auto completion but fairly limited.

Geany interface


I tried them both for coding JavaScript. I have to admit that SublimeText is more elegant, stylish, and has better syntax highlighting in some cases. But it is not free (as in free speech and free beer). I'm not bashing SublimeText but as someone who advocates open source, I'm determined to embrace Geany, and you should give Geany some favors too.

The more I use Geany, the more potential I think it has. Thanks to its current support of extra configuration files, I found it is relatively easy to fix some issues of its current syntax highlighting and add some automatic code completion for a specific language.

So I created some supplement files to enhance Geany in coding of HTML/CSS/JS (required some manual works with Copy-n-Paste and some regular-expression search-replace). I have posted them on GitHub for version control and for anyone interested to contribute to it. I also have a more detailed instruction at the GitHub project on how to install these files and what have been enhanced.

Here are some screen shots featuring my Geany's enhancement for front-end dev:

- Better source code highlighting


- Code completion for JavaScript (currently: core classes, some DOM & Mootools)


- Function parameters hinting for JavaScript:


- Property completion for CSS (with latest CSS3):


I'm looking into enhance it further. But for now Geany-for-front-end-dev is quite nice for me to work with.

7 comments:

  1. Thank you for your efforts and for sharing them. I recently started using Geany myself, and like you also stumbled upon Sublime Text which admittedly looks pretty cool.


    Thanks to efforts by people like you I will still be enjoying using Geany for quite some time. :)

    ReplyDelete
  2. Geany does indeed have a great deal of potential. Make sure you delve into the keybindings; there are lots of useful actions that aren't bound to any key by default!

    I'm particularly interested in the Lua plugin, and its possible successor GeanyPy, which allow you to essentially write your own mini-plugins with a short piece of script.

    Haven't used Sublime much, so I can't really compare. Does it have an equivalent of Geany's WebHelper plugin?

    ReplyDelete
  3. I have to work on a Mac (iOS PhoneGap projects) so I've been using SublimeText quite extensively for now. SublimeText does have some plugins that are equivalent to Geany's WebHelper. One of them is https://github.com/sokolovstas/SublimeWebInspector . But Tincr and Chrome's Developer Tools are enough for me (and platform independent)

    Many people have been creating plugins for ST so it is really powerful now. But by itself, I have found multi-cursor, quick file search, and various selection key bindings are its useful features that I'll wish Geany has.

    One last thing, it's still bugging me that there's no official build of Geany in OSX that has forced to use SublimeText. I have tried to fix and build Geany on OSX myself but the lack of GTK knowledge and free time have prevented to continue.

    I'm still watching Geany's progress and hope it will grow to success.

    ReplyDelete
  4. In case my comment gets too long so that people stop reading it, I want to point out this awesome tool for customizing your geany syntax highlighting

    http://geanycolourscheme.xtreemhost.com/filetypes/

    ....And now for some useless thoughts....
    I've been using Geany for years, and I think it's one of the best editors out there. Mega-configurability, yet tiny footprint. I've recently started using Sublime Text, not because I have any problem with Geany, but because some of my developer-friends said I just HAVE TO try it. I'm just getting started with sublime and so far it seems fine. But I do expect that I'll eventually go back to Geany.

    ReplyDelete
  5. What do you mean "multi-cursor"? Geany has support it for ages. I'm using quite old version (v 0.20) and it has multi-cursor selection/typing exactly like the one you found on Sublime.

    Cheers :)

    ReplyDelete
  6. Oh really? I should have over looked. Thanks for pointing that out. Probably I'll go check back with Geany and do another comparison some time.

    ReplyDelete