最近闲来无聊,又想把VIM Tutorial Book 翻出来看看。好东西总是有让人想去掌握的冲动啊!杯具的是,每次都是从Chapter1开始,然后到Chapter2就无疾而终了。
希望这次可以持之以恒下去。每次看都做点札记,以勉励自己,提醒自己吧。
*Be careful about the VI-compatibility mode which means you will lose many advanced Vim features and the VIM mode*
:set nocompatible<Enter>
this kind of {:x} commands need an implicit <Enter>
Modes
The Vim editor is a modal editor
Normal mode/Command mode: the bottom of the screen displays the filename or is blank
Anytime you can press <ESC> to get back to normal mode
Insert mode: the indicator displays --INSERT--
Visual mode: indicator shows --VISUAL--
Chapter1: Basic editing commands
four movement commads:
h left
j down
k up
l right
deleting commands:
delete a line: dd
delete a word: x
<*********这个我对它其实概念不清啦,估计用的也不会太多**********
Undo commands:
undo the last edit: u
undo all the changes made on the last line that was edited: U(uppercase) 这个的使用有点乱,建议还是不要用了!
Redo command:
undo too many times, reverse the preceeding command: ctrl+R
发现Ctrl+R和Ctrl+r好像没区别
*******************>
Getting out commands:
ZZ
:q!
:wq
:w
inserting commands:
insert before the cursor: i
insert after the cursor: a
openning up a new line commands:
new line above cur line: O
new line below cur line: o
Help command:
:help
Using a count to edit faster:
3a!<Enter> === a!!!