Excerpt from: http://blog.csdn.net/niushuai666/article/details/7275406I. Installation of VIM
sudo apt-get install vimSecond, use
Two modes of vim: Normal, Insert
- After starting vim, Vim is in Normal mode.
- Let's go into Insert mode, press the key I. (Chenhao Note: You will see a –insert– word in the lower left corner of vim, indicating that you can enter it as inserted)
- At this point, you can enter the text as if you were using Notepad.
- If you want to return to Normal mode, press the
ESC
key.
Here are some commands that you can take in
NormalMode survived
i
→ Insert mode, press ESC
back to Normal mode.
x
→ Delete one character of the current cursor.
:wq
→ Save + exit (save :w
, :q
exit) (Chenhao Note:: W can be followed by file name)
dd
→ Delete the current line and save the deleted line to the Clipboard
p
→ Paste Clipboard
Recommended
hjkl
(strong example recommends using it to move the cursor, but not necessary) → You can also use the cursor key (←↓↑→). Note: j
just like the down arrow.
:help <command>
→ Displays help for related commands. You can also type without :help
command. (Chenhao Note: Exit help requires input: Q)
Vim Simple to use