Hold on, I am indeed a follower of EMACS cult :) but VIM was the first editor I learned. Why do I need to learn to use an editor, one might say. Surely, writing in Microsoft or Google Doc, we don’t have to. Why is VIM special? Let’s dive into it.
Magic mode
Once you open VIM, you are in a magic mode called normal mode
officially. I prefer to call it magic mode
where every keystroke is magic, which is why you can’t type like the normal. To type like the normal, you need to enter the insert mode
from magic mode
by pressing magical key such as i
. Then you need to use Ctrl+[
or ESC
to go back to magic mode
. What can I benefit from magic mode
? Why do I need to learn the abnormal behavior? Short answer is making editing more efficient. Oh, btw, you can exit VIM only from magic mode
by pressing :q
.
Fast movement
In magic mode
, you can move by words with b
, w
, e
, B
, W
, E
keys; move by sentence with (
and )
; move by paragraph with {
and }
; find chars linewise with f
, F
, t
, T
. no longer use arrow key instead using h
, j
, k
, l
which all located right in the center of QWERTY
keyboard layout; If you use another different keyboard layout eg DVORAK
, you have the absolute control to customize the key map.
Key mapping
A good editor should be extendable and customized, so is VIM
.
My minimal vim configuration
|
|