I use the following command to remap the Caps Lock key to Esc:
setxkbmap -option caps:escape
Unfortunately, I have to type the command every time I create a new session. I tried putting it in my .bashrc but it did not work. I guess the keyboard settings must be getting overwritten somehow after the .bashrc has run.
How can make the key binding automatically occur?