If I have a string like 0xff0000, and select it by double-clicking,
then go to the color chooser and choose a new color and hit Enter, I
get the text replaced -- as I'd expect.
Same thing works if I use Shift-Alt-W to select the word.
Same thing works if I go to the beginning of the word and hit
Shift-Ctrl-RightArrow to select.
Something a bit different happens if I go to the *end* of the word and
hit Shift-Ctrl-LeftArrow to select it. The color doesn't get replaced
There's no problem when using the '#00ff00' syntax, instead of the
I'd like to see Geany's default key combo choices be as optimized
and clean as possible. This is a long post -- I hope it's useful. The
seeds of this post were planted in a post I made here back on
In my experience, some editors' key-combos are easier than
others for brain and fingers to remember. I think a large
part has to do with choices regarding key-combinations.
Aside from some common Gnome/GTK+ keys combinations such as:
* Ctrl-o to open a file,
* Ctrl-s to save,
* Ctrl-f to find,
* Ctrl-arrow_key to move by-word or by-paragraph,
* Ctrl-BackSpace to delete back,
* and so on,
I see 9 major ways text editors use keys to activate
commands. Those 9 ways are noted below, along with examples
of Geany using most of them. The purpose of this longish post
is to help tune Geany's editing component for maximum ease of
use, memorability, uniformity, and editing speed (that is,
It seems to me that some ways of handling key combos are
easier to use and remember than others. Also, an editor that
sticks to some minimum number of those patterns seems to be
easier to use. Here's the patterns I notice, along with
example Geany commands:
1. Hit a key to toggle something.
* Ctrl-B (comment/uncomment line)
* Ctrl-M (set/unset marker)
* Ctrl-T (transpose lines)
2. Hit a key to do something, then Shift-key to reverse it.
* Ctrl-I, Shift-Ctrl-I
* Ctrl-G, Shift-Ctrl-G
* Ctrl-U, Shift-Ctrl-U
* Tab, Shift-Tab
3. Hit a Ctrl-key to do something, then Shift-Ctrl-key to do
even more, or maybe a similar thing but with a twist.
* Ctrl-F, Shift-Ctrl-F
* Ctrl-O, Shift-Ctrl-O
* Ctrl-S, Shift-Ctrl-S
* Ctrl-W, Shift-Ctrl-W
* Ctrl-R, Shift-Ctrl-R
4. Ctrl-key to do an action, Alt-key to do something similar,
but with a twist.
5. A key to do one thing, and a separate key to do its opposite.
* Ctrl-+, Ctrl--
* Ctrl-., Ctrl-,
* Ctrl-[, Ctrl-]
6. Ones that use the fancy named keys.
* Ctrl-PgUp, Ctrl-PgDn
* etc... (a lot of the #3 and #4 style, above)
7. Alt-key, and Shift-Alt-key to do a variation on Alt-key.
8. Using the F_keys (at the top of the keyboard). Shift-F_key
just like Shift-Ctrl-key and Shift-Alt-key.
* F3, Shift-F3
* F9, Shift-F9, Shift-Ctrl-F9
9. Ctrl-Alt-key, Alt-F_key, Shift-Ctrl-F_key .... yikes.
Here's what I've found regarding using those various key-
* Item 1. Toggling is fast and intuitive if the feature that
it activates makes sense to toggle. Also nice is that it
only uses up one key combo.
* Item 2. Using Shift to reverse an action doesn't feel right.
I think brain and fingers tend to associate a key with an
action, and shifting it should do something similar in some
way, not opposite.
* Item 3. Using Shift to "extend" an action seems quite
intuitive. Using Shift to also deal with selecting text (with
arrow keys) does not seem to cause any confusion here.
* Item 4. This can feel intuitive once you get used to it, but
will likely be confusing if using Shift like in item 3 above.
* Item 5. Intuitive, and works fine you've got Ctrl-key
combos to burn.
* Item 6. Pretty much the default for GUI apps. Like 'em or
not, we've got 'em.
* Item 7. Using Alt-key/Shift-Alt-key is analagous to item 3
above and works very well. Good for either less often used
functions, or maybe specialized or fancier ones. Although
some Alt-key's get used to activate menus, there's plenty
left over for other uses.
* Item 8. These are awful for heavy use (they're a mile away
from the home row!) and, IMO, should only be used for
seldom-used commands (ex. window-related functions, build
commands). There's no way one can successfully hit them
during serious editing without having to look down at the
keyboard and take a hand off the home row.
* Item 9. Here be dragons (that is, these are the ones that
are tougher to remember, or that risk interefering with the
So, given all that, to even more finely tune Geany's editing
environment, here's my suggestions:
A. Get rid of using Shift to make a key combo do the opposite
(item 2 above). This includes:
* Ctrl-I, Shift-Ctrl-I --> Not needed. See below.
* Ctrl-G, Shift-Ctrl-G --> Use Ctrl-G to toggle.
* Ctrl-U, Shift-Ctrl-U --> Use Ctrl-U to toggle. Then use
Shift-Ctrl-U to toggle first-letter capitalization. Yes. :)
* Tab, Shift-Tab --> use Ctrl-9 & Ctrl-0 to indent/de-indent
by one space, and Ctrl-) & Ctrl-( to indent/de-indent by
one tab width.
B. Fix an oddball case:
* Shift-Alt-D for insert date. This one's not too bad, but
falls outside of the uniformity of having Shift-Alt-key be a
fancy version of Alt-key. Maybe use Alt-I (for "insert")?
C. The mortal sin: Incremental search. Geany's Achilles' heel.
One of an editors' most-useful features, it should be be
effortless to do forward and backward incremental searches.
As implemented, if I want to incrementally search forward, I
need to hit F7, tap F3 to get to the one I want, then F2 to
get back to the editor. So, I've basically got to spend the
entire search looking at my hands instead of the text. It's
even worse to search backward incrementally -- not sure I can
even do this. Here's my proposed solution. Buckle seatbelts,
and please observe the no-smoking signs:
1. Steal Ctrl-T. Use it for forward incremental search (think
of it as "to" or "incremen*t*al"). Same as today's F7.
Move "transpose lines" to Shift-Ctrl-L.
2. Shift-Ctrl-T gets you find next (like F3).
3. Use Alt-T to start a reverse incremental search (Use Alt-O
to get the Tools menu).
4. Shift-Alt-T gets you find previous. Nice consistency
here, I think.
5. Hitting Ctrl-LeftArrow or Ctrl-RightArrow should snap you
out of the incremental search and back to the main editor
window (instead of today's F2). After an incremental
search, you often either want to go to the beginning or
end of the word you found anyway.
When you're in an incremental search, regardless of
direction, you should be able to tap either Shift-Ctrl-T to
find next, or Shift-Alt-T to find previous.
Finally, some new key combos to possibly add that would probably
be pretty useful, and don't stomp too much on anything else:
1. Select line. Use Alt-L
2. Select paragraph. Use Alt-P (switch Project menu to Alt-R)
3. Select word. Use Alt-W
Please let me know what you think.
By the way, I know that I can just change many of the above-
mentioned key-bindings myself. But the point is, I think Geany
might benefit from some discussion on optimizing some of its
Incidentally, can someone please point me to the docs on
creating my own ~/.geany/keybindings.conf? I looked in the
"Keybindings" and "Configuration files" chapters of the manual,
but didn't see any info.
I have written a very basic Lua scripting plugin for Geany.
So far, it is only able to do a few simple things:
1) Create a Tools menu showing a list of scripts
from the user's config folder, e.g. ~/.geany/lua/.
2) Retrieve and/or modify the current document's text
In order to achieve this, I needed to expose a few more
functions to the plugin API:
So before I go any further, some questions:
Will it be OK to expose this stuff?
Any ideas for other "must have" script functions?
The attached patch adds the functions mentioned above, I hope
post the code for the plugin soon, but I still have a bit of
clean up to do and maybe write some simple docs for using it.
Also note that since the patch is only preliminary/tenative,
it doesn't bump the API/ABI version numbers like it should.
Just a short notice: geany SVN needs the Debian package "intltool" for
compiling, whereas "intltool-debian" was sufficent until one or two
`o_ o ) `-. ( ).`-.__.`)
(_Y_.)' ._ ) `._ `. ``-..-'
_..`--'_..-_/ /--'_.' .'
(il).-'' (li).' ((!.-'
Andreas Tscharner andy(a)vis.ethz.ch
http://www.vis.ethz.ch/~andy ICQ-No. 14356454
I came across geany recently, was pretty much impressed by it.
I have built it on Solaris Express(OpenSolaris based distro) using sun
studio compiler and created a Solaris SVR4 package out of it. A very
minor patch that was required after ./configure is attached for
- Find in files does not work by default since Solaris /usr/bin/grep
doesn't support the gnu options. /usr/sfw/bin/ggrep is to be used on
Solaris Express. But this was easily configurable via
Thanks for the wonderful tool.
The demo plugin calls the global function info() to try and
get its own name. This worked fine before the classbuilder
plugin was added, but now the demo plugin says:
"Hello World! (From the Class Builder plugin)"
Apparently because the global info() function gets bound to
the first (alphabetically) loaded plugin.
The simple solution is to not call info() from inside a plugin.
The attached patch offers another (somewhat ugly) solution...
In filetypes.common, regarding the comments for the white_space
setting, for clarity, you might change them from:
# the third argument defines whether to use the foreground colour or
use the default value defined by the filetypes
# the fourth argument defines whether to use the background colour or
use the default value defined by the filetypes
# Third argument: if true, use this foreground color. If false, use
the default value defined by the filetypes.
# Fourth argument: if true, use this background color. If false, use
the default value defined by the filetypes.
I have a question about function list in geany. (just downloaded it
today and i like it :)
I'm working on a PHP project. It seems that geany only recognises
functions starting with 'function'. If I start the function with 'public
function ...' it won't be recognized as function and won't show up in
the function list. Anywhere I can configure this?