[Addon] Leader Key: Leads the way to more hotkeys.


(Miniu) #1

Vim like ‘leader’ key functionality for blender.

In my workflow I use a lot of shortcuts, so much in fact that now I can’t really find empty slots for new bindings. So I looked to other software that I love and use a lot of hotkeys in: Vim. In Vim shortcuts can be specified as sequence of keys. For example:

nnoremap <leader>cf :call_function()<CR>

Means that after pressing leader key followed by c and f keys call call_function(). Reading sequence of characters as shortcut means that we get a lot of new possible shortcuts without having to stretch our hands all-over the keyboard.

Thats the functionality I tried to replicate in this add-on.

Detailed instructions and addon itself can be found at: https://github.com/miniukof/bl-leader_key


(burnin) #2

Yes!
in trunk
:eyebrowlift:
Thanks!
Oh, how i missed this.


(Spirou4D) #3

A great idea @Miniu, congratulations.
I agree with you about a lot of shortcuts…:o


(Miniu) #4

Thanks for kind words ^^.

Just found out that installing add-on as downloaded zip file wasn’t working so i changed that. Now you have to install it as a whole zip file though, which i think is still better then not being able to install it as zip at all considering that that’s the easiest option of downloading add-ons from github.


(Oyster) #5

can it record a lot of operation as a lot of hotkeys?


(Miniu) #6

What do you mean? Function can be anything in python really, it’s just a call to exec() function. So you can even type whole script in that input really if you want to. You would just have to do it all in one line.


(burnin) #7

Uf, a thought (sorry if off topic)…
Do you know if it is possible to have something like a command line (rhino, autocad…) in blender. As when we press space and use search line to call function, but to be always open (at bottom or top, at hand and as a visual feedback)?

Maybe i should address it as v 2.8 suggestion?


(Miniu) #8

I think you could. I would have to look into that but i think dynamic-spacebar add-on uses that search button as a operator? So you could maybe theoretically add it to some menu and have it open.


(MADCello) #9

Good night to all!
This is still working?
Thank you.


(kabu) #10

Oh, good. Some problem as you, I wanted a esc-key-key vim like sequence so much…
Thank you so much!


(MADCello) #11

I don’t know how Vim works, but an autocad like shortcuts it would be heaven!


(Miniu) #12

Yeah, still works ^^’


(MADCello) #13

Good night Miniu!
Did not fully understand it at first, got it to work and is very close to what I’m after!
Are you open for a suggestion? :slight_smile:
Thank you!


(Jakroval) #14

I love AutoCad like shortcut, and it little icon button that can be customize all the commands you like on to a favorite bar.


(Miniu) #15

Yeah, feel free :slight_smile:


(MADCello) #16

Thank you Miniu!
How about saving the shortcuts list in a text file near the PY file?
It will be much easier to keep track of shortcuts.


(ToshiCG) #17

Gotta give this a try!


(MADCello) #18

Miniu, I hope you don’t mind if I make some tweaks in Your Script?


(MACHIN3) #19

Oh yes, as a vim user, I’ve thought countless times to do build this myself. Thanks!


(MADCello) #20

Oh please, MACHIN3!
I’m just a once in a while curious about Python. It will take me months to do something usable (more than this beautiful Script by Minius)!
You, as an amazing programmer can do it in a blink of an eye!