I have noticed that when coding I type underscores much more often then dashes. Is it possible to swap these keycodes so I can type shiftless underscores? I am using linux (chromebook developer mode).


I'm surprised there wasn't more about this specific remapping out there, considering how popular snake_case is.

sudo xmodmap -e "keycode 20 = underscore minus underscore minus"

and to get back to normal:

sudo xmodmap -e "keycode 20 = minus underscore minus underscore"

For anyone wanting to map other keys, see: https://wiki.archlinux.org/index.php/Xmodmap

Basically, run xmodmap -pke to see what the keys are currently mapped to (it gives you the same format as the commands I wrote above), and use xmodmap -e to make your changes.

|improve this answer|||||

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.