syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.64k stars 4.89k forks source link

[UX][Which-key][Feature request] Hide package and command prefixes in which-key side-windows/minibuffer #16045

Open bryce-carson opened 1 year ago

bryce-carson commented 1 year ago

I believe it would be a large benefit to users, at least beginning users, to hide the package prefixes (à la [in the style or manner of] nameless-mode) within the which-key side window. "ergonomics, mnemonics and consistency" means that we should focus on the psychological ergonomics and weight of reading projectile-, magit-, and helm- too often. Furthermore, the package prefixes reduce the number of characters left in a column of the which-key display, reducing the usefulness of the actual key-based mnemonics (SPC f f stands for find-file, but that is an un-prefixed command) and the visual feedback / the description itself.

In many cases, which package provides a command is irrelevant to understanding the effect of the key. It has not been too long since I started using Spacemacs, only three years, and I can recall how I thought about the keys and package prefixes when I was beginning.

When I began, I wondered what packages provided certain behaviours. For instance, it wasn't immediatley obvious to me that SPC j w was provided by the avy package, because I was entirely unfamiliar with the packages available from the Emacs community, and I was more concerned with what effect issuing the command has than what package provides it. I still wondered, but as I learned more and more, especially gaining the command of the Help system, I found I could get the description of any key and see what Lisp command is called by that key. I belive that should be favoured over continuing to /not/ hide the package prefixes in the which key side windows.

Consider the command / key descriptions following SPC F, the Frames prefix. Screenshot at 2023-06-16 13-48-04 This prefix doesn't include any package namespaces, other than Dired, but that's an acceptable prefix to not hide because it indicates the behaviour of the command ("open Dired in the other frame").

By default, Emacs' key description for the other-frame command is "Switch to other frame", which is perfectly apt and doesn't include any extra information, such as that it is a built-in command (it is not prefixed with emacs- or frame-).

The key descriptions in the Frames prefix are excellent, and should serve as a guide.

Including the following lines in my user config changes the appearance of many keys; see the next screenshot. Because I am using Unicode glyphs (Font Awesome icons work as well!) it does not play well with the column spacing in which key's display, but we could work as a /community/ to configure the descriptions of the keys.

Spacemacs which-key short desc

  (push '((nil . "projectile") . (nil . "•")) which-key-replacement-alist)
  (push '((nil . "helm") . (nil . "⎈")) which-key-replacement-alist)
  (push '((nil . "spacemacs") . (nil . "℠")) which-key-replacement-alist)
  (push '((nil . "magit") . (nil . "")) which-key-replacement-alist)
bryce-carson commented 1 year ago

Here is a screenshot of the "+git/versions-control" prefix map with the default Spacemacs dark theme and the default font, Source Code Pro, for reference. Screenshot at 2023-06-16 14-10-53

github-actions[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!