Linux / Unix: Install and Use Geany Integrated Development Environment

by on January 7, 2013 · 10 comments· LAST UPDATED January 13, 2013

in Howto, Open Source, Programming, Reviews, Web Developer

Geany is a great and light weight cross-platform integrated development environment for Linux and Unix based systems. It supports C, C++, Java, PHP, Python and 50+ other programming languages. Geany is known to run under Linux, FreeBSD, NetBSD, OpenBSD, MacOS X, AIX v5.3, Solaris Express and Windows. Geany more closely resembles programming editors available for Microsoft Windows such as Notepad++. So if, you are switching from MS-Windows to Ubuntu/Debian/Fedora/Mint or BSD/OS X/Unix like platform try geany IDE.

Features

From the project home page:

Geany was developed to provide a small and fast IDE, which has only a few dependencies from other packages. Another goal was to be as independent as possible from a special Desktop Environment like KDE or GNOME - Geany only requires the GTK2 runtime libraries. Features of Geany:

  1. Syntax highlighting
  2. Code folding
  3. Symbol name auto-completion
  4. Construct completion/snippets
  5. Auto-closing of XML and HTML tags
  6. Call tips
  7. Symbol lists
  8. Code navigation
  9. Build system to compile and execute your code
  10. Simple project management
  11. Plugin interface

Install Geany Under Debian or Ubuntu Linux

Type the following command:
$ sudo apt-get install geany geany-common
Debian Linux user can install latest version using backports:
$ sudo apt-get -t squeeze-backports install geany geany-common

Install Geany Under CentOS / RHEL / Fedora Linux

First, turn on EPEL repo and type the following yum command to install geany:
# yum install geany
Sample outputs:

Loaded plugins: auto-update-debuginfo, protectbase, rhnplugin
0 packages excluded due to repository protections
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package geany.x86_64 0:0.21-1.el6 will be installed
--> Processing Dependency: vte for package: geany-0.21-1.el6.x86_64
--> Running transaction check
---> Package vte.x86_64 0:0.25.1-7.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================================
 Package           Arch               Version                  Repository                        Size
======================================================================================================
Installing:
 geany             x86_64             0.21-1.el6               epel                             2.8 M
Installing for dependencies:
 vte               x86_64             0.25.1-7.el6             rhel-x86_64-server-6             354 k
Transaction Summary
======================================================================================================
Install       2 Package(s)
Total download size: 3.1 M
Installed size: 11 M
Is this ok [y/N]:

Install geany under FreeBSD

To install the geany via port, enter:
# cd /usr/ports/devel/geany/
# make install clean
## plugins ##
# cd /usr/ports/devel/geany-plugin-addons/
# make install clean

To add the binary geany package, enter
# pkg_add -r geany
## plugins
# pkg_add -r geany-plugin-addons

Install geany under OpenBSD

Type the following command:
# export PKG_PATH=http://mirror.esc7.net/pub/OpenBSD/`uname -r`/packages/`machine -a`/
# pkg_add -v -i geany

Install geany under Linux / Unix using source code

Geany is available through the official Debian / Ubuntu and other archives. However, you will get older stable version. To install the latest version type the following commands:
$ cd /tmp
$ wget http://download.geany.org/geany-1.22.tar.gz
$ wget http://download.geany.org/geany-1.22.tar.gz.sig
$ wget http://download.geany.org/colombanw-pubkey.txt
$ gpg --import < colombanw-pubkey.txt
$ rm colombanw-pubkey.txt
$ gpg --verify geany-1.22.tar.gz.sig geany-1.22.tar.gz

Untar the tar ball, enter:
$ tar xvf geany-1.22.tar.gz
Compile geany, enter:
$ cd geany-1.22/
$ ./configure
$ make

Install geany, enter:
$ sudo make install
Start geany, enter:
$ /usr/local/bin/geany

How do I start geany?

Simply type the following command:
$ geany
Or, choose in your application menu of your used Desktop Environment:
Applications > Development / Programming > Geany
Sample outputs:

Fig.01: Geany in action

Fig.01: Geany in action


A simple hello.c (hello world) program:
Fig.02: Geany IDE: hello.c - build and executed program

Fig.02: Geany IDE: hello.c - build and executed program


Geany has its own build system. In above example, I compiled and executed program without having to open a terminal window or another application.

Geany plugins

Geany has a feature rich plug-ins. By default, it will install a few plug-ins in your system. To see current plug-ins, visit:
Tools > Plugins Manager
Sample outputs:

Fig.03: Geany IDE Plugins

Fig.03: Geany IDE Plugins


Type the following command to see plugins list:
$ apt-cache search geany-plugin
Sample outputs:

geany-plugin-addons - miscellanous plugins for Geany
geany-plugin-doc - a documentation plugin for Geany
geany-plugin-gdb - GDB plugin for Geany
geany-plugin-latex - improved LaTeX support plugin for Geany
geany-plugin-lipsum - Lorem Ipsum generator plugin for Geany
geany-plugin-lua - Lua scripting plugin for Geany
geany-plugin-prj - an alternative project manager for Geany
geany-plugin-sendmail - mailer plugin for Geany
geany-plugin-shiftcolumn - text column shifting plugin for Geany
geany-plugin-spellcheck - spellcheck plugin for Geany
geany-plugin-vc - VCS plugin for Geany
geany-plugins-common - set of plugins for Geany (translations)
geany-plugins - set of plugins for Geany
geany-plugin-codenav - code navigation plugin for Geany
geany-plugin-debugger - debugger plugin for Geany
geany-plugin-extrasel - extra selection plugin for Geany
geany-plugin-gendoc - documentation generation plugin for Geany
geany-plugin-gproject - gproject plugin for Geany
geany-plugin-insertnum - number inserting plugin for Geany
geany-plugin-macro - macro plugin for Geany
geany-plugin-numberedbookmarks - numbered bookmarks plugin for Geany
geany-plugin-pg - pg plugin for Geany
geany-plugin-prettyprinter - XML pretty printer for Geany
geany-plugin-tableconvert - table convert plugin for Geany
geany-plugin-treebrowser - tree browser plugin for Geany
geany-plugin-updatechecker - update checker plugin for Geany
geany-plugin-webhelper - web helper plugin for Geany
geany-plugin-xmlsnippets - XMLSnippets plugin for Geany

To install VCS plugin for Geany, enter:
$ sudo apt-get install geany-plugin-vc

Editor features

Geany offers various editor features such as:

  1. Auto save.
  2. Auto backup.
  3. Autocompletion.
  4. Word part completion.
  5. Auto close quotes and brackets.
  6. Code indentation.
  7. Scope autocompletion.
  8. Snippet keybindings and much more.

Visit Edit > Preferences:

But wait, there's more!

Geany has a dedicated third-party plug-ins repository at plugins.geany.org. What you will find here is a lot of plugin stuff for Geany. There is a Geany Plugins project containing a lot of plugins, which is developed by various developers on GitHub.

Conclusion

I liked geany because of its speed and small size. You do not need to install entire KDE or Gnome desktop or Java bloat to use GUI based IDE. It lets me compile and execute / debug code without having to open another terminal. Visit the following resources for more information:

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

  • Danny

    I used and loved geany for a long time. If you’re looking for a leg-up on gedit or pluma, this is a must-have. Its the plugins that make it great.

    I used geany mostly for PHP, javascript, HTML, CSS, R, and bash, -mostly because it is SO MUCH FASTER than java-driven IDE’s like netbeans and eclipse. But I swear by Sublime Text 2 now. I’ll probably never go back to geany.

    My biggest qualm with geany as a simple editor (unlike gedit) was that I couldn’t open files on mounted filesystems. Not a huge deal, but it sure gets annoying real fast when you want to. (I still use gedit for that. Or vi)

  • Roman Borisenko

    I wanted to try it, but after I read it resembles microsux notepad, I leave it. It means ‘Linux’ writer is not GNU guy at all.

  • dorin

    Under Archlinux:
    pacman -S geany geany-plugins

  • metasansana

    Minor error: sudo apt-get geany geany-common should be sudo apt-get install geany geany-common

  • Gustavo Novaro

    My favorite editor, Geany have column mode like UltraEdit and others greats features

  • nixcraft

    Thanks for the heads up :)

  • Arif Budiman

    I’m install geany in kde (linuxmint 13 kde) and geany doesn’t work as usual. Geany builds and compiles with g++, but it cannot run the file. What I see is a blank console screen every time I ran a cxx file.

    Geany commands:

    compile : g++ -Wall -c “%f”
    build : g++ -Wall -o “%e” “%f”
    excute : “./%e”

    How fix it?

  • xr09

    Geany does not resembles notepad in any other thing that both can edit text, geany is a powerful editor with very interesting features, (you can write addons in lua), has syntax highlighting for tons of languages and lots of plugins.

  • totolinux

    Geany is really a good tool for those reluctant to Eclipse mess… And it’s really a multi-platform solution as it also works under windows. A little annoying bug for the latter is when you use it with multi-desktop windows add-ons: Window is not refreshed properly after switching desktop back.

    In fact, the only reason I can’t use it more is it’s not able to sftp (or sshfs) on a remote system: Most of the times, ssh server is present on team build hosts in corporate environments with conf management/sources to log-in/remote X for development… but no NFS mounts for security reasons.

    And even if present on build host, geany is already too X ressource hungry for full remote use: Only nedit or emacs console version will make the job. Geany must run on user host and be able to use remote files in the currently most standard way: SSH.

  • rashid

    when start geany getting this error geany

    Geany: cannot open display

Previous post:

Next post: