I'm trying to add a key binding by doing the following:

(global-set-key (kbd "SPC-;") 'spacemacs/default-pop-shell)

but it gets interpreted as the separate keys S, P, etc and produces the error:

global-set-key: Key sequence S P C - ; starts with non-prefix key S

What is the correct way to map something starting with SPC?

I'm not sure if any of this is specific to Spacemacs, but that's the distro I'm using.

2 Answers 2


The answer was posted by @duianto on the Spacemacs gitter:

(spacemacs/set-leader-keys (kbd ";") 'spacemacs/default-pop-shell)

You can use:

(kbd "<SPC> ;")
  • That produces the same error, but now it says that the key sequence starts with non-prefix key SPC instead of S.
    – kbdluv
    Dec 29, 2017 at 17:32
  • 1
    Ah, I see. The original post contained two problems. One (which I solved) was the syntax of kbd. The other that space isn't a prefix key (which I assumed it was). Dec 29, 2017 at 18:26
  • 1
    Yes, sorry about the confusion. Thank you for teaching me how to use kbd with <SPC> :)
    – kbdluv
    Dec 29, 2017 at 19:39

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.