Vim Usage Tips 14

Source: Internet
Author: User

Children's shoes that often use VIM may notice that in the actual operation, in the insertion mode is very little, more is to view and browse, occasionally modified. Therefore, it is very important to quickly exit from insert mode into normal mode. There are four main ways of doing this:

First, in the insertion mode, by pressing the <Esc> button, quickly switch to the normal mode, if it is already in the normal mode, the mode will not change;

Second, in the insertion mode, by pressing the <C-[> button, quickly switch to the normal mode, if it is already in the normal mode, the mode will not be converted; The effect is exactly the same as the first way, it is the first way of effective substitution, feeling more choices;

Third, insert-normal-insert mode, when you are entering text, if the temporary discovery row position is unreasonable, you can use <C-o> to execute commands in normal mode, for example

1. <C-O>ZZ displays the current line in the middle of the screen first

2. <C-O>ZT displays the current line at the top of the screen first

3. <C-O>ZB displays the current line at the bottom of the screen first

Iv. can use <CapsLock> as an additional <Esc> key

Personally, I think there's a reason:

1, in the programming process rarely will be a large number of uppercase letters,<capslock> key is almost wasteful, the most important is the position of <CapsLock> key is very good, distance from the left hand finger of the standard key is very close, very convenient to use;

2, as a heavy user of Vim,<esc> use is very frequent, and <Esc> key distance from the left hand finger of the standard key is very remote, and may even need to leave the keyboard to get the left hand;

3, holding the principle of not wasting <CapsLock> key as an extra <Esc> key idea is very meaningful, you can use a variety of means. If you're using Linux, the desktop uses the KDE desktop environment, then go ahead.

(1), menu--Settings--system settings or Terminal Run command SYSTEMSETTINGS5

(2), hardware--input device--keyboard

(3), advanced--caps lock Behavior--make CAPS LOCK an additional ESC selected

Click Apply, log off, and you can use it.

Vim Usage Tips 14

Related Article

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.