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