5

I want to globally replace C- with SPC in emacs. This should make almost all emacs bindings not awful chords, and should completely avoid colliding emacs with evil/vim. It should also be able to be done globally and automatically so you don't have to futz with new plugins to make them compatible with evil (unless they use things like single characters to do things). This also seems like a single consistent change, so there is a chance that it is not hard to do.

For example, C-x f becomes SPC x f, C-x C-f becomes SPC x SPC f. Perhaps M- becomes SPC SPC, so M-x is SPC SPC x.

I have two questions:

  1. Are my assumptions correct? They are: this will make emacs and vim not collide, this will make most plugins compatible with evil out of the box.
  2. How do I actually do it?
  • EmacsWiki has an article about mapping C- to other keys, including space-bar. emacswiki.org/emacs/… – user12878 Aug 4 '16 at 11:24
  • Have you tried remapping CAPS LOCK to C- ? – OrgAddict Oct 4 '16 at 9:07
2

God Mode might be close to what you're after.

https://github.com/chrisdone/god-mode

What I am liking about god mode is that for short operations, the usual suspects work. If I am just saving a file, it's a simple C-x C-s. If I am doing some heavy editing (killing, yanking, moving, etc) then I can enter god mode and everything is implicitly prefixed with Control.

1
  1. It's not as simple as it sounds. Besides global keybindings, there are numerous keymaps, almost all major and minor modes install their own. It is possible, see below, but much more work than it seems. Tons of gotchas. I am using Prelude with evil, with a lot of my tweaks, and I keep ironing out wrinkles almost every week.

  2. If you want smooth emacs and evil integration, and fond of using space as modifier, then why not give Spacemacs a try? That's exactly what you are describing, within realm of possible of course (but incomparably better than you or I would do alone in a few weeks or even months, trust me.)

1

I'm not a vim/evil user, so I can't speak to the wisdom of this, but this seems to be pretty close to what you want:

(define-key key-translation-map (kbd "SPC") 'event-apply-control-modifier)
0

If you are on macOS, there is karabiner. It can dual map both control and SPC to spacebar. If you press SPC only, it's considered as a spacebar, but if you press SPC along with any other key it's considered as control + whatever key you've pressed. And, the best part is, you can use control key in itself for modifiers too. It's left untouched.

  • There was another command line tool which allowed you to do the same for linux like systems. I can't seem to remember it now. – Chakravarthy Raghunandan Oct 4 '16 at 12:28

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.