Replacing <up> and <down> keys in Echo Area

Sorry, I’m a total noob, and I’d like to replace the up and down keys for navigating the Echo Area (with M-k and M-j).

I can’t use SPC h k ... to find out what function the up and down keys invoke because I’m already in the middle of a keystroke whenever they come up. I can’t inquire about the mode I’m in down there for similar reasons.

Regarding finding the command, you can use the help commands pretty much anywhere. In this case, C-h k <up> (where is the up arrow) will show which command is bound to up.

Now, regarding your desired outcome. Are you referring to the mini-buffer? I’ve bound them like so (there might be a way with map! too):

I’m using vertico, so the following would work in this case:

(define-key! :keymaps +default-minibuffer-maps
  "M-k" '#vertico-previous
  "M-j" '#vertico-next)

You can replace them with the commands you found above.

Aah, I had only tried SPC h k which doesn’t work in the minibuffer, but c-h k works. Yes, those vertico commands are the ones I’m looking for and your snippet worked (with #' instead of '#). Though I ended up writing it as (map! :map minibuffer-mode-map "M-k" #'vertico-previous) (map! :map minibuffer-mode-map "M-j" #'vertico-next) Thanks!

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.