Linux modify the keyboard mapping capslock to ctrl

  

Because in the vim need to use the ctrl key often, such as ctrl+] jump between the tags, ctrl+v into the column visual mode, etc., but because the ctrl key is more troublesome to press Map capslock to ctrl. Need xmodmap support

First, install xmodmap

sudo apt-get install xmodmap

If the prompt does not install

sudo apt-get install x11-xserver -utils

After creating a .xmodmaprc file in your working directory home, type


1

remove Lock = Caps_Lockkeysym Caps_Lock = Control_Ladd Control = Control_L


Save.

In the shell, cd to the directory where xmodmaprc is located

xmodmap .xmodmaprc

Make the mapping take effect.

If you don't take effect, you should be able to log out.

Copyright © Windows knowledge All Rights Reserved