What would be the best way to configure Emacs to handle the above keybindings for vanilla Emacs? Specifically, I'd like to have SPC work as C-x and SPC SPC work as M-x. I love Spacemacs for the bindings, but want to build up a vanilla install with a better understanding of the underpinnings.


You could do this:

(global-set-key (kbd "SPC") ctl-x-map)
(define-key ctl-x-map (kbd "SPC") 'execute-extended-command)

Although occasionally modes will define a SPC binding which would take precedence, so rather than using the global map you're perhaps wanting a solution like: https://stackoverflow.com/questions/683425/globally-override-key-binding-in-emacs

I don't really understand how you're planning to type spaces without a great deal of muscle-memory issues, unless you make the new behaviour modal -- but you've not described any requirement for that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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