cofi / evil-leader

<leader> key for evil
GNU General Public License v3.0
315 stars 22 forks source link

feature request: a second leader key #25

Closed redguardtoo closed 9 years ago

redguardtoo commented 9 years ago

Since my workflow is heavily dependent on evil-leader (https://github.com/redguardtoo/emacs.d/blob/master/lisp/init-evil.el), I found second leader key is useful.

The second key is reserved for less used commands with some graphic hint, like https://github.com/abo-abo/hydra

for example, I map <leader>ww to save file, hint is not necessary in this case.

but for sort-lines, I cannot remember its hotkey "sl" because I seldom use sort-lines, so a little hint is helpful to make my actually use the hotkey.

fleimgruber commented 9 years ago

I see a possible solution to this using guide-key and the existing evil-leader functionality; so you would go with e.g.,

(evil-leader/set-leader ",")
(evil-leader/set-key "s s l" 'sort-lines)

with the mnemonic ,-s meaning the "seldom"-prefix and for guide-key

(setq guide-key/guide-key-sequence '(",s")

which enables hinting for all commands that have the common ,-s prefix (look also for guide-key/recursive-key-sequence-flag in case). That way you can even define multiple "sub-leader" sequences with configurable hinting for each one.

redguardtoo commented 9 years ago

yes, thank you!