I use an xmodmap script (which in turn uses xcape) which remaps Caps Lock to be a modifier (when it is pressed on conjunction with other keys) and escape (when it is pressed and released on its own).

Before installing spacemacs, this worked fine in emacs (at least in terminal mode). After installing Spacemacs, it doesn't work in terminal mode. That is, pressing CapsLock does nothing (so that I can't, for example, go from insert mode to normal mode).

Here is my actual xmodmap/xcape config:

setxkbmap -layout us
xmodmap -e "keycode 66 = Hyper_L"
xmodmap -e "remove mod4 = Hyper_L"
xmodmap -e "remove lock = Hyper_L" 
xmodmap -e "add mod3 = Hyper_L"
xmodmap -e "keycode any = Caps_Lock"
xcape -e "Hyper_L=Escape"

Question: How can I get this intended functionality working with spacemacs?

  • 1
    Please post your question edit as an answer to the original post. (I can't imagine why viper is involved; maybe you have some curiosities in your init file?) Once the system lets you, you can accept your own answer.
    – Dan
    Jul 7 '17 at 16:58

For future reference, (defun viper-translate-all-ESC-keysequences () nil) fixed my problem.

  • For future reference, could you also start with a minimal init file (just vanilla Spacemacs) to determine if there really is some conflict with viper, or if it's something odd in your particular init?
    – Dan
    Jul 10 '17 at 14:29

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.