Exchange ctrl and caps lock

Source: Internet
Author: User

Exchange ctrl and caps lock because the ctrl key is in the lower left corner of the notebook keyboard, It is a pain for people who often use the ctrl key. I searched the internet and found several methods for exchanging key locations. Here I will record them. The first method is to use xmodmap. Create a new file ~ /. Xmodmap, add the following content: remove Lock = Caps_Lockremove Control = Control_Lkeysym Control_L = Caps_Lockkeysym Caps_Lock = Control_Ladd Lock = Caps_Lockadd Control = Control_L and then execute xmodmap ~ /. Xmodmap 2>/dev/null. If you do not want to manually enter the command for each startup, you can write the command ~ /. Xinitrc. Note that if you write the command ~ /. In bashrc, the above command is executed every time a new terminal or tab is opened, so that the key bit is changed back. Another method is to use the setxkbmap command. Run the following command: setxkbmap-option ctrl: swapcaps. You can also place the commands in ~ /. In bashrc, repeated execution is not affected. (Updated on February 02,) You can use the GUI option in gnome. Choose system> preference> keyboard> layout> option... -> Ctrl key position, and select "Swap Ctrl and CapsLock. In addition to switching ctrl and caps lock, there are also exchanges with alt, so that you can use two thumbs to press ctrl and alt respectively (switching right ctrl and alt ): remove mod1 = Alt_Rremove Control = Control_Rkeysym Control_R = Alt_Rkeysym Alt_R = Control_Radd mod1 = Alt_Radd Control = Control_R why do you want to exchange the ctrl key? One day, when I was hanging out on the Internet, I accidentally saw this article, and suddenly I was so excited that I thought about how awesome emacs was with the right hand of vim. To show your determination to learn, install emacs and unload vim, which has been around for five years. It took a few weeks to touch the mouse. The deepest feeling was that the left-hand finger was too hard. Even if we exchanged ctrl and caps lock, it was also very tired and painful to make a small finger in a day, so I used vim. If you are not motivated to learn about emacs, you can read the article above. If you have been using vim or have never used the two, try it. Maybe you will fall in love with it. Even if it may be scared off, I believe it will get a lot from the learning process. For example, I can simulate several mobile location shortcuts in vim, it is convenient to switch the input method or to pair characters such as input parentheses and quotation marks: "emacs-style key bindingsinoremap <C-a> <C-o> ^ inoremap <C-B> <left> inoremap <C-d> <del> inoremap <C-e> <C-o> $ inoremap <C-f> <right> inoremap <C-g> <esc> inoremap <C-k> <C-o> Dinoremap <C-o>- n> <down> inoremap <C-p> <up> inoremap <C-t> <esc> xpiinoremap <C-y> <esc> pa is more exaggerated. ctrl and enter are replaced, after all, there are many times to use ctrl in emacs, and enter can use ctrl-m and ctr. L-j instead, so that the small fingers of the two hands can open the bow left and right.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.