How to scroll a prompt window

What happened?

{{{When starting a shortcut, I’m getting several pages of suggestions (1 of 2), for instance. How can I scroll to the second page? I’m sorry if the theme is formatted improperly; I can’t guess how to start a preview window here.}}}

If this isn’t about which key, and you’re using the standard evil mode, you can C-j and C-h to navigate through your options.

If this is about which key than it gets a bit tricky to do in doom. In vanilla emacs you can C-h j, but that doesn’t seem to work in doom.

What you can do out of the box is SPC h b b and get a list of available keybinding to search and navigate.

I’ve tried to remap the which-key-show-next-page-cycle with no success, as any key presses seem to interfere with which key itself.

If anyone knows where I’ve gone wrong these are some of the things I’ve tried,

(after! which-key
  (map! :map which-key-mode-map
        :m "C-n" #'which-key-show-next-page-cycle))

and

(after! evil-collection-custom-maps
  (map! :desc "which key next page"
        "C-n" #'which-key-show-next-page-cycle))

I’m not sure I made myself clear enough. Let me describe it in detail.

  1. (SPC w). Status bar: SPC w- window (1 of 2). No idea how to get to the window 2. The cursor is in the editor window, as it should be.

  2. (C-j C-h) as per your advice. Status bar: C-h- help-command (1 of 2). I checked the shortcuts and the result is understandable, but irrelevant.

Yes, I use the vanilla evil mode.

UPD:

The prompt window is called minibuffer, they say.

The suggestions you’re getting are coming from a package called which-key

This seems to be a particularly difficult buffer to navigate around, because it’s listening for key presses to update the buffer.

The workaround is using SPC h b b this pops up a buffer of all the keybindings available, and gives you a fuzzy search into it. So if you wanted to find all the SPC w keybindings you would just type SPC w, and then scroll down/up through possibilities with C-j/C-h

It does not really work with sequences containing spaces. It’s pure madness, anyway. I prefer to believe that I’m still failing to make myself clear…

UPD:

A hint found: there’s no [C-h paging/help] prompt. Nothing at all, not even empty brackets.

The C-h binding in SPC w prefix shadows the which-key’s C-h.

Simple workarounds are e.g.

  • Use ? instead of C-h in which-key popup

  • Undefine SPC w C-h

    Since the SPC w h already does the same.

    (map!
     :after evil
     :map evil-window-map
     "C-h" nil)
    
1 Like

Your workaround helps with SPC w ..., but won’t work with g ....

Why there’s buzz about workarounds anyway? which-key is preinstalled with the current version of Doom Emacs; why shouldn’t it work out of the box?

When searching for keys with spaces you have to type the letters s p c instead of hitting the space bar, i.e., spell out the commands as written when searching for them by string.

Of course. Unfortunately, it’s still unusable.

I recently found a solution to this on reddit!

Add (setq which-key-use-C-h-commands 't) to your config, and then hitting C-h while in which-key will prompt you with keys to navigate the buffer.

https://www.reddit.com/r/DoomEmacs/comments/17v7tp6/is_there_a_way_to_scroll_the_whichkey_completion/?utm_source=share&utm_medium=web2x&context=3

This topic was automatically closed after 360 days. New replies are no longer allowed.