參考資料: [https://blog.csdn.net/jsut\_rick/article/details/81945771](https://blog.csdn.net/jsut_rick/article/details/81945771)
relation between vi and vim, vi is the basics, vim is the advanced
vim: it has three modes:

2.1 【default】Command mode(命令模式),
1. move the cursor
2. copy, cut/delete, past
a) copy current line: yy
b) paste:p
c) copy multiple lines: 3yy
d) delete current line: dd
e) delete current letter: x
f) delete from current position to the end of line: d$
g) delete multiple lines: 2dd
h) delete current line, but leave the empty space : D
3. undo(ctrl +z), undo undo (ctrl+y)
a) u to undo
b) ctrl + r to undo undo
2.2 endofline mode(末行模式)
1. save modification, and to quit
2. search for some content, and replace the content with something else
for :
a) save changes, :w :w newfilename
b) quit, to exit the file, :q
c) save and quit, :wq
d) to quit without saving changes, :q!
e) if you are using root, use :w! to even modify a readonly file
for /
after the search, to use n to find next match, to use N to find previous match
to replace, substitue
substitute current line, :s/target/xx (only substitue the firt match)
substitute current line, :s/target/xx/g (substitue all matches in current line)
substitue multiple lines, :n,ms/target/xx :n,$s/target/xx
2.3 edit mode(編輯模式)
1. modify by typing anything you like
i :cursor stays at original position, and letter will be inserted before the cursor.
I :cursor goes to the beginning of the line
o: cursor goes to next line
O:cursor goes to previous line
a :cursor goes to next position,and letter will be inserted after the cursor
A :cursor goest to the end of the line
- 第一章 Linux
- 1. Linux安裝和網絡配置
- 2. Linux基本命令
- 3. Xshell和winscp
- 4. VIM編輯器
- 5. 安裝軟件
- 5.1 安裝JDK
- 5.2 安裝TOMCAT
- 5.3 安裝MySql
- 5.4 安裝Nginx
- 5.5 部署工程
- 第二章 Nginx
- 1. 安裝Nginx
- 2. 配置Nginx
- 2.1 配置靜態服務器
- 2.2 配置反向代理
- 2.3 配置負載均衡
- 2.4 配置動靜分離
- 2.5 跨域訪問
- 第三章 Redis
- 1. 安裝Redis
- 2. JAVA操作Redis
- 3. Redis事務
- 4. Redis持久化
- 5. 主從復制和集群
- 6. Redis實現Session共享
- 第四章 MySQL主從復制
- 4.1 MyCat安裝
- 4.2 MySQL主從復制
- 4.3MySQL讀寫分離
- 第五章 ActiveMQ
- 5.1 Queue
- 5.2 Topic
- 第六章 FastDFS圖片服務器
- 第七章