(For more resources related to this topic, see here.)
Quick text editing
Geany provides quick text-editing facilities. You can make use of these by going to Edit | Commands, Edit | Format and the Documents menu.
The following are some examples; please note that there are many facilities and I cannot list all of them here:
- Use the Tab key to quickly indent a block of code:
- Use a shortcut key or a command to quickly comment out a block of code:
For other tools, you can see the keyboard shortcut on the menu and you can set it by going to Edit | Preferences | Keybindings:
The <Primary> key in the preceding screenshot is the Ctrl key.
Navigating through the source code
I feel that navigating through source code in Geany is better and faster than any other IDE I’ve ever tried.
To navigate in the same file, you can use the following features as shown in the following screenshot and explained thereafter:
- Symbol list: Click on one item in the list and you will be brought to where the symbol is defined. Very few free IDEs or editors provide this feature; if they do, it is not as capable or fast as Geany
- Go to Tag Definition: Clicking on this will take you to where a function is defined and from where it is used.
This feature has limitations when used alone in Geany. It can only look for definitions in the files being opened. So, to enable it to look for definitions in other closed files in the same folder, you must use this feature inside a certain project created by Geany’s built-in Project feature, with the File patterns defined, and combine it with other project plugins that support Generate file list on load.
- Find Usage and Find Document Usage: These features help you look for the lines in which a function/variable is used. You can also jump to these lines from the result list. These are more convenient than the usual find/search dialog.
To navigate between files, you may find the tree browser (1) and addons (2) plugins useful, as shown in the following screenshot:
Not only can Geany work with a single file on demand, but it also provides some basic management for working with a group of files in a project. This feature helps you reopen files from the last session when reopening Geany. It also helps you change some default parameters (indentation type, command to build and run, and so on) and apply those on all files. And don’t forget its role in navigating through the source code, as described previously.
Using the Project feature is easy. All things related to it can be found in the Project menu.
With the increasing use of source version control (SVN and Git), cleaning the space automatically gets important in order to avoid polluting the Commit history with meaningless changes, caused accidentally by some whitespace additions/removals.
You should make Geany do this automatically, by con figuring the settings after going to Edit | Preferences | Files as shown in the following screenshot:
If you want a feature that you cannot find built in to Geany, or you want to discover something new and funny, you need to pick and turn on some Geany plugins.
To see the list of installed plugins, please go to Tools | Plugin Manager.
Some noteworthy plugins are as follows:
- Addons: It shows a button with a dropdown menu displaying a list of opened files, to allow you to switch quickly between them
- Code navigation: It adds more support to the built-in code-navigation feature
- Debugger: It helps to integrate with GDB ( GNU Debugger) and other debuggers
In this article, we discussed the most commonly used tasks in Geany and how to perform them, along with the most widely used features and plugins of Geany.
Resources for Article:
- 10 Minute Guide to the Enterprise Service Bus and the NetBeans SOA Pack [Article]
- User Extensions and Add-ons in Selenium 1.0 Testing Tools [Article]
- Installing and Setting up JavaFX for NetBeans and Eclipse IDE [Article]