The Wayback Machine - https://web.archive.org/web/20090208180750/http://www.linux.com:80/feature/139882

Linux.com

What is Linux?

Learn about Linux

Download Linux

Get Linux help

Special Offers

Get special offers on:

Linux
Application Dev
Programming
Software

Email:

Feature: Reviews

Fast, powerful Geany editor offers IDE features

By Dennis L. Ericson on July 09, 2008 (9:00:00 AM)

Share    Print    Comments   

Geany is a lightweight text editor for Linux based on the GTK2 toolkit. Geany supports internal and external plugins, and it excels as a source code editor, since it includes basic integrated development environment (IDE) functionality. Here's an introduction to using Geany's built-in features, including the IDE and built-in development capabilities.

Geany requires only the GTK2 (>= 2.6.0) runtime libraries (including Pango, Glib, and ATK libraries), and is not dependent on any X window manager or desktop environment. For reference, my system is a standard Dell laptop running Absolute Linux 12.1, which comes loaded with all the tools needed (as do most Linux distributions). You will also need a C/C++ compiler and the make utility.

Most Linux distributions have a binary package for Geany, but most are not up-to-date with the current 0.14 release, which is available in a gzip-compressed source code tar file. If you want the latest, you must download and build it. Geany uses the normal Linux configure, make, make install (as root) installation process. Perform the following steps in a console shell after downloading the tar.bz file to your home directory.

cd ~ tar -zxvf geany-0.14.tar.gz cd ./geany-0.14 ./configure make sudo make install

If all went well, you should be able to run Geany 0.14 by typing geany & on a command line.

The default setup for Geany displays three panes: the main code window, a sidebar on the left, and a message area on the bottom. The sidebar contains one tab for symbol definitions within the current file, and another for documents you currently have open. The message area contains five tabs, for Geany status messages, compiler execution messages, general Geany messages, a Scribble tab for note-taking, and a terminal for executing shell commands within Geany. Figure 1 shows the layout, along with the main Preferences screen (under the Edit pull-down menu), which allows a multitude of configurable features; you can see its tab headings on the left side of the window.

Geany supports everything developers need to edit source code, including cut and paste, search (including limited expressions), replace, indentation, code folding, syntax highlighting (for more than 30 common languages), line wrapping, filetype (CR/LF), white space and tab conversion, column mode, symbol list support, drag and drop editing, standard CTRL-z undo, and a host of other editing features.

Geany as IDE

To highlight Geany's IDE features, let's try a (trivial) development code change to the source code from Geany itself, after which we'll compile and install it.

First we need to configure our build setup for the Geany source code. Under the drop-down menu Build -> Set Includes and Arguments, edit the Build line to say make (Figure 2). Using Geany, edit line 174 of /src/about.c, and replace ("A fast and lightweight IDE") with ("A SUPER fast and lightweight IDE"). Press F9, or from the menu click on Build -> Build (no need to save first). The Compiler tab of the bottom message window will show the results of the compile request.

Then, under Terminal in the bottom message window area, su or sudo to root, cd ~/geany-0.14/src, and type make install. After exiting and reloading Geany, go to Help -> About, and you should see the change you made: 'A SUPER fast and lightweight IDE.'

Let's go back and look at the symbol list in the sidebar window for the file about.c, which includes functions, macros, and variables, listed alphabetically with the line number in parenthesis. Clicking on any of these will bring you to that line automatically. If you want to see the list arranged in order in the file, click Document -> Fold All.

Related to the symbol list, let's look at tags, which allow you to find definitions of functions, macros, and variables. Geany has built-in tag generation and tag support, although it's not compatible with other tag standards such as Exuberant Ctags. Tag generation took me some time to figure out, as it appears to need full path specifications as well as a specific tag filename format, but I was able to get it to operate correctly by running the following command from the /src/ directory:

geany -g geany014.c.tags ~/geany-0.14/src/*.c ~/geany-0.14/src/*.h

This generates a Geany tag file for .c and .h files; note the '.c.tags' format of the tag file. Loading the tag file was easy, using the drop-down item from the Tools menu. The biggest disappointment for tags though is that Geany supports tag definition jumping (click on the tag, then right-click to pull up a menu) only with files that are open; if a file is not open, Geany does not open the new file and jump to the tag definition. However, autocomplete works fine, displaying a menu of possible completions from the global tags file as you type each letter (four letters or more).

Geany also has limited support for projects under the Project menu. Creating a project defines the base directory for builds, and provides a convenient way to access files -- that is, each time you open a project, the files you had open before are opened again. In addition, the build tools (Make and Run) change based on project, so if you were writing C code in one project and Perl in another, you could have and maintain separate build parameters. And although not configured as default, a built-in plugin manager (Tools -> Plugin Manager) is provided to list the project files on the sidebar window, a typical feature found on most IDEs.

In addition to the file browser plugin, Geany is shipped with several other plugins that are not enabled by default: Auto save (automatically saves all open files), Classbuilder (creates source files for new class types), Export (exports the current file into different formats), HTML Characters (inserts HTML character entities), and Version Diff (creates a patch of a file against a version control system; currently Subversion, CVS, and Git are supported). In addition there are many more external plugins available for downloading, including spell checking (via aspell), backup with each save, and SendMail support. These external plugins exist as source code and have to be downloaded and compiled to be used.

Geany also offers templates that allow developers to insert prepared text where desired in the code. All can be configured, although some require changes to Geany text files (see ~/.geany/templates/). Templates are available for ChangeLog Entry, File Header, Functional Description, and BSD/GPL notices. Templates can also be set up for an entire filetype, so each new file always contains all necessary boilerplate information.

New since Geany 0.13 is printing via GTK. Previously Geany printed only via an external command, which made printing with a remote printer on CUPS difficult. With GTK print support, printing on any CUPS printer is as easy as with any other application, with the selection of available printers popping up in a window when the print command is requested. You can even print multiple pages on one sheet, something I have done often when printing large source listings. If you are using an older version of Geany, updating to 0.14 is worth it just to get better printer support.

But all is not rosy, as there are some common IDE features that are missing in Geany. Although there is supposed to be a plugin available for debugging using the GNU Debugger, I was unable to find and download it using the link provided, so I cannot say whether Geany supports source-level debugging. Geany also does not provide a way to see differences between versions of a file, although there is some plugin support for this when you're using a version control system. And although Geany supports C++ and other object-oriented languages, it does not provide any object-oriented tools, such as a class browser or class hierarchy diagram.

In summary, although it lacks a few features found in full-fledged IDEs, Geany is a wonderful, fast, and useful source code editor, supporting most of the functionality needed by developers. I am a little disappointed that tags don't work when the applicable file is not open, and there is no file difference tool included. On the positive side, the build tools work well, and autocomplete is a great time-saver, as it helps reduce function/variable misspellings. The triple window interface is conveniently laid out, and Geany supports everything regarding source code editing that you could need.

Dennis L. Ericson is a real-time embedded systems software engineer who resides in West Hartford, Conn.

Share    Print    Comments   

Comments

on Fast, powerful Geany editor offers IDE features

Note: Comments are owned by the poster. We are not responsible for their content.

Fast, powerful Geany editor offers IDE features

Posted by: Anonymous [ip: 10.92.20.230] on July 09, 2008 09:28 AM
Yeah, just discovered Geany on my fedora system only last week. I wanted a quick way to edit php code without using the weight of KDE's Quanta plus environment. Does the job superbly, lightweight yet very powerful. I would recommend this to anyone. Wouldn't go as far as say its fully fledged IDE such as Kdevelop, Eclipse etc. but most people dont need these heavyweights.

+1

#

Fast, powerful Geany editor offers IDE features

Posted by: Anonymous [ip: 148.2.224.140] on July 09, 2008 09:58 AM
Link in article is "corrupt" http://http//geany.uvena.de/ should be http://geany.uvena.de/

#

Fast, powerful Geany editor offers IDE features

Posted by: Anonymous [ip: 10.241.128.10] on July 09, 2008 10:08 AM
Thanks for a useful and informative article.

#

Fast, powerful Geany editor offers IDE features

Posted by: Anonymous [ip: 89.175.165.2] on July 09, 2008 12:52 PM
Somehow I encountered Geany at the time when its stable version was called 0.11. I tried it and immediately switched to it from KDevelop in Linux and Notepad++ in Windows. That is really fast and light-weight environment-editor. I truly believed that Geany would be noticed and would increase its user base. This article is a clear evidence of spreading awareness about this IDE-editor. Now I hope this short article will be a milestone in Geany’s popularity.

But I’m afraid that by the time it reaches version 1.0 it will become as slow at launch and cumbersome in use as KDevelop. I use Geany for PHP scripting and hence do not need brilliant features that other IDEs propose to their users who develop using compiled languages.

Geany calls php, passes my script and returns error messages, if any. Surely this is already more than simple code editor, as some people are trying to present Geany.

One thing I dissatisfied with Geany is the way it works with links in Windows (I’ve to use this OS at work). Geany cannot open a folder by link. When I try to open a file by clicking a folder’s link at desktop Geany opens clear text field. I hope even if this is GTK’s bug it could be overcome in Geany.

Thank you to Geany developers!
Tony.

#

This is supposed to be a review??

Posted by: Anonymous [ip: 82.192.250.149] on July 09, 2008 04:07 PM
Dear Linux.com: any review must include AS A MINIMUM the following -

1. A list of existing free-software packages which do the same job as the package being reviewed. The list needn't be complete, but must give some basis for the next point (see below). At least Eclipse, Kdevelop, and Netbeans should have been mentioned.

2. A comparison with at least one other free-software package which does the same job. The Free Software world suffers from massive duplication in some areas and massive holes in other areas, and packages which just offer "yet another" alternative where there are plenty of alternatives already should be discouraged. It can be harmful to have too many alternatives for something, because the result can be that no one package attracts enough users to be thoroughly debugged.

#

Fast, powerful Geany editor offers IDE features

Posted by: Anonymous [ip: 199.253.126.3] on July 09, 2008 04:50 PM
Hi,

Aren't there simply too many editors? Perhaps there should be focus on innovating new features in the existing editors (as if Emacs' features weren't enough). Duplication of effort is one of Linux's major problems, is also one of its greatest sources of novelty. Where can we draw the line?

#

Fast, powerful Geany editor offers IDE features

Posted by: klo on July 09, 2008 05:57 PM
Oouh, this looks like a promising EditPlus replacement - thanks for the article!

#

Fast, powerful Geany editor offers IDE features

Posted by: Anonymous [ip: 24.248.89.66] on July 09, 2008 10:13 PM
I started using Geany because it's one of the few text editors that allow you to have block text select. Just do Ctrl click and you are in business. I think the only other one I could do this in is FTE, and it's a powerful tool way back when I used MrED on OS/2 (now called MED on Windows) Geanny removed the temptation to go back to this proprietary application.

The fact it's lightweight was also a bonus. I now install Geany on any Linux or Windows box I use.

#

Block text select

Posted by: Anonymous [ip: 91.84.13.8] on July 09, 2008 11:32 PM
Block text select is simple in (g)vim.

#

Re: Block text select

Posted by: Anonymous [ip: 89.175.165.2] on July 10, 2008 07:21 AM
Yes, but not for me. As i have mentioned above I could do it only in FTE.

#

Re: Block text select

Posted by: Anonymous [ip: 87.61.53.234] on July 10, 2008 07:27 AM
block select is just not enough. It needs to be real column edit, like in Ultra Edit, Crimson Editor or Gedit with the column plugin.

#

Fast, powerful Geany editor offers IDE features

Posted by: Anonymous [ip: 76.94.213.82] on July 10, 2008 07:18 AM
Geany definitely looks like an full fledged text editor ready for a heavy duty work. I'll definitely check this out. Thanks for the article about the text editor. I used Jedit earlier and looking for some alternative editors to play with.

Ramesh
http://www.thegeekstuff.com

#

Fast, powerful Geany editor offers IDE features

Posted by: Anonymous [ip: 24.25.130.248] on August 05, 2008 03:06 AM
The environment does, in fact, have class support. It has Class, Member and Function browsers in the Symbols pane. My only complaint about the software is the current difficulty of setting up debugging support, although I may be able to hack something together.

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya