vi
A 行尾增加
I 行首插入
R 一直替換
hjkl 上下左右
數字0 行首
$ 行尾
G 最後一行
1G/gg 第一行
nG n行
n<Enter> 向下移動n行
n<space> 向後移動n字
nyy 複製n行
p 粘貼
/word 查找
n 向下查找
N 反向查找
dd 刪除整行
dnG 刪除光標到n行
n1,n2s/word1/word2/gc
n1到n2行word1替換爲word2
c爲確認
1,$s/word1/word2/g
=
%s/word1/word2/g
:n1,n2 w filename
寫入n1,n2行內容到新文件
:r filename讀入另一文檔內容在遊標行後
:set nonu 取消行號
:!command 暫時離開vi執行command
:!cat test.txt
:sp filename 多窗口編輯
ctrl+wj 移動到下方窗口
ctrl+wk 移動到上方窗口
ctrl+ww窗口切換