[Geany] tuning Geany key combos

John Gabriele jmg3000 at xxxxx
Tue Jun 26 15:43:27 UTC 2007


On 6/26/07, Enrico Tröger <enrico.troeger at uvena.de> wrote:
> On Tue, 26 Jun 2007 00:41:07 -0400, "John Gabriele" <jmg3000 at gmail.com>
> wrote:
>
> [snip]
>
> >    * Ctrl-U, Shift-Ctrl-U --> Use Ctrl-U to toggle. Then use
> >      Shift-Ctrl-U to toggle first-letter capitalization. Yes. :)
> What about this string "aBcD" -> toggle to lower or upper case?

I've found that the only times I need to mess with capitalization are:

1. When I've got a capitalized word that starts a sentence, but I add
a word in front of it, so need to make the capitalized word lowercase.
Likewise if I delete some words at the beginning of a sentence and
want the next one to start the sentence, I need to capitalize it. Also
sometimes when hopping through a sentence word-by-word and need to
capitalize some proper names. Not *too* common, but sometimes handy.

2. To either make something all caps, or to make something all
lowercase if someone was yelling at me. :)

I've never had to swap case as you describe. What situation would one
need to do that?

> >    * 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.
>
> Who needs indentation by one space?

When you select some text (say, you're cleaning up some
poorly-indented code), and you need to shift it around but aren't
exactly sure what column you need it at. You "tap right a few times,
left, ah -- got it".

Also sometimes if you're putting ascii-art things in your comments
(like primitive diagrams with boxes and arrows) and you're trying to
make them line up right.

Also if you're writing out a list:

* one
* two
  * two point five
  * two point seven
five plus epsilon
* two point eight
* two point nine
* whoops -- indented these last lines wrong.

and need to move those last lines out by 2 spaces.

> I want to keep the Tab/Shift-Tab
> behaviour because I think it is very commonly.

Yeah, it is pretty common.

> But because of talking about indentation: I plan to add a feature to
> auto indent current line by pressing a key. This means, the current
> line will be indented according to the previous line independent of the
> current indentation(maybe too less or too much indentation).

Heh. That sounds exactly like what Emacs does. :)

> My
> suggestion: Alt+I to be similar to Ctrl+I / Ctrl+Shift+I

Yeah, those fit together well.

>
> > [snip]
>
> > 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.
>
> Basically good idea, anyway I prefer to keep F3 and Shift+F3 for
> searching forwards and backwards just because of its common usage
> (remember Geany != Emacs ;-)). And IMO the F-keys are not that far away
> from the main keys (or my fingers are just a bit longer ;-)).
> But we can surely improve the current behaviour of incremental search.

Well, if there's a command like F7 but which starts the search going
the opposite way, then it looks like users can customize the behaviour
to get the above, if they want it. Can we get a Shift-F7 ("reverse
searchbar search") so I can remap it to Alt-T? :)

Without having Ctrl-arrow_key to get out of the incremental search
box, for now, it's easy enough to remap F2 to somewhere else I
suppose.

> > 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)
> Above two sound nice. Could be implemented.
>
> > 3. Select word.      Use Alt-W
> Already present. Look for the binding "Select current word".

Nice! Didn't see that in there. :) Thanks.

>
> In general, Alt+letter key bindings are not very good for GUI apps.
> Because Alt+letter opens a file menu item where letter is used as a
> mnemonic(the underlined letter in the file menu item). And remember,
> the file menu items are translatable. I.e. you can't know which Alt
> +letter keybinding is used in any translation for any file menu item
> (I only speak of the first level menu items, File, Edit, View, ...).
> An example: Alt+T opens the Tools file menu item in Geany without any
> translation. To open this menu in Geany with a German translation you
> need Alt+W (German translation is "Werkzeuge").

Oh my. Hm. Didn't realize they changed for different languages.

Ok, well, I see that the Preferences --> Keybindings tab does not
provide a way to change the keybindings for activating menus. If I
assign a command to a key binding that's already used for a menu, the
function I assigned it to seems to get precedence.

So, currently, if I use an Alt key that's already being used for a
menu, then I lose the ability to activate that menu via the keyboard.
If you're committed to using those menu name first letters along with
changing them for various translations, then users will just have to
live with stealing Alt key bindings sometimes.

Personally, the only time I've ever used the Alt keys to activate
menus was once a long time ago when my mouse got unplugged somehow
while using a GUI and I needed to save and shutdown the computer. :)
But maybe other folks use them regularly.

>
> > Incidentally, can someone please point me to the docs on
> > creating my own ~/.geany/keybindings.conf? I looked in the
>
> No docs so far. Just open the preferences dialog, keybindings tab and
> change what you like to. After that, the file
> ~/.geany/keybindings.conf is created with your changed settings.

Ah. Sweet. I see: change one, and they all show up in the
keybindings.conf file. Nice.

---John


More information about the Users mailing list