[Geany] tuning Geany key combos

John Gabriele jmg3000 at xxxxx
Tue Jun 26 04:41:07 UTC 2007


Hi,

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
May 8.

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,
sans mouse).

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)
   * F11
   * 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-
combination patterns:

* 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
  window manager).


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
defaults.

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.

Thanks,
---John



More information about the Users mailing list