help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Which modifier to use?


From: arthur miller
Subject: RE: Which modifier to use?
Date: Sat, 5 Dec 2020 22:34:07 +0000

"I think it is little known that you can define keys in this way, I
learned it while setting up which-key.  If you use that package, the car
of the alist will appear as the description, allowing you to create sort
of poor man's menu system.  :)"

Thanks!

Yes, I use which-key,  but I certainly didn't know I could define keys with 
descriptions. Not sure I have use for it immediately, but interesting indeed!

-------- Originalmeddelande --------
Från: TRS-80 <lists.trs-80@isnotmyreal.name>
Datum: 2020-12-05 22:30 (GMT+01:00)
Till: help-gnu-emacs@gnu.org
Ämne: Re: Which modifier to use?

> On 2020-12-05 10:03, Arthur Miller wrote:
>
> I leave Super to my window manager and xbindkeys; and all other
> modifiers go to applications. It is a rule. Makes life easier if you
> switch between Windows and GNU/Linux

Luckily I can avoid Windoze nearly 100% of the time nowadays, however I
still follow this rule and think it's a great idea, anyway.

I use i3 (wm) and have lots of custom keybindings at the OS/WM level,
they are all based on using Super as modifier.  So, in my mind, Super
(aka "Win") has to do with window manager.

Inside Emacs, I also group related keybindings behind a sort of "leader"
key, for example (dk here is alias for define-key, stricty to shorten
these lines so I can keep nice formatting):

(dk global-map (kbd "C-c y")   '("Yankpad"               . nil))
(dk global-map (kbd "C-c y c") '("Capture"               .
yankpad-capture-snippet))
(dk global-map (kbd "C-c y e") '("Edit"                  .
yankpad-edit))
(dk global-map (kbd "C-c y i") '("Insert"                .
yankpad-insert))
(dk global-map (kbd "C-c y r") '("Reload"                .
yankpad-reload))
(dk global-map (kbd "C-c y R") '("Repeat"                .
yankpad-repeat))
(dk global-map (kbd "C-c y s") '("Set (local) category"  .
yankpad-set-local-category))
(dk global-map (kbd "C-c y S") '("Set (global) category" .
yankpad-set-category))

I think it is little known that you can define keys in this way, I
learned it while setting up which-key.  If you use that package, the car
of the alist will appear as the description, allowing you to create sort
of poor man's menu system.  :)

Cheers,
TRS-80


reply via email to

[Prev in Thread] Current Thread [Next in Thread]