I'm trying to unmap the <next> and <prior> key-bindings from Treemacs, because I find counterintuitive that it's the only place where they scroll a different window instead of the current one.

I've found that they are mapped inside keymap treemacs-mode-map, so in my .spacemacs user-config section I call this:

  (with-eval-after-load 'treemacs
    (unbind-key (kbd "<next>") treemacs-mode-map)
    (unbind-key (kbd "<prior>") treemacs-mode-map))

But when I try to open the treemacs panel I get this error message:

Wrong type argument: stringp, [next]

I also tried with (unbind-key <next> or (unbind-key next or (kbd "PageDown" and nothing is working.

1 Answer 1


Section of the docstring of bind-key:

KEY-NAME may be a vector, in which case it is passed straight to ‘define-key’. Or it may be a string to be interpreted as spelled-out keystrokes, e.g., "C-c C-z". See documentation of ‘edmacro-mode’ for details.

So simply use (unbind-key "<next>" treemacs-mode-map) instead of (unbind-key (kbd "<next>") treemacs-mode-map).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.