On Fri, 1 Mar 2024 at 05:03, e.antonoff--- via Users
<users@lists.geany.org> wrote:
>
> Hello,
>
> PROBLEM: I want to make key bindings for some custom tools I set Geany to 
> run. Geany version 1.38 "Sulamar", running on Lubuntu 22.04 LTS.
>
> So in the "Set build commands" panel I have set some custom python utilities 
> to run. Please see the included screenshot. So far so good and they work when 
> I execute them from within Geany.
>
> My accent for the question are what I defined under "Python commands" - mypy 
> and Lint (which runs 'flake8') and then on the bottom in "Execute commands" 
> as "Pythonic format" which runs 'black' (yes, unfortunately there are only 3 
> entries for "Python commands", while I need 4 in reality but so far I can 
> live with it).

Edit->Preferences->Various->build.number* can set as many menu items
to each section as you need.  They default to 0 because originally
these "Various" settings were to be added (ie there was no default
entry) by editor to settings files because Geany must be restarted for
them to take effect, so the Build menu code guarantees the default
values of 3,4,2 as shown in the Build settings dialog so errors in the
files won't make the menu unusable.  But when the Various section was
added to preferences, the code has no method to set the values to
3,4,2 in the new menu elements if the file has no entries so it shows
0 :-(.

But...

>
> Actual QUESTION is - HOW to assign key bindings for the 3 tools I am most 
> interested in - mypy, flake8 and black ?

...the keybindings menu Edit->Preferences->Keybindings->Build is
fixed, so it can only assign keybindings to the original Menu items
that existed before the build menu was made variable.  Fixing that
will take a serious redesign of the keybindings menu since the whole
thing is designed fixed AFAIK, and so nobody has done it.

But ...

>
> The "Set build commands" panel does not offer such thing and in Preferences > 
> Key bindings > Build I don't see the tools I have set in "Set build commands".
>
> In fact maybe there is a way to add any number of custom tools for Geany to 
> run with various keybindings, but I haven't figured it out yet ?

... even though you cannot set single key keybindings you can set
accelerators for all the Build commands, Alt+b to show the menu and a
character (shown underlined in the menu) to activate the command.  You
set this character in the Build settings menu by placing an underscore
in the label before the character, eg Foo_bah will make the
accelerator b.  The accelerators should be unique across all your menu
labels of course.

Bottom line, you can set as many build menu items as you want, but
can't set keybindings for any other than those that existed before the
Build menu was made variable but you can set accelerators instead.

Cheers
Lex

>
> Thanks!
>
>
> _______________________________________________
> Users mailing list -- users@lists.geany.org
> To unsubscribe send an email to users-le...@lists.geany.org
_______________________________________________
Users mailing list -- users@lists.geany.org
To unsubscribe send an email to users-le...@lists.geany.org

Reply via email to