vi editor
vi/vim
vim编辑器模式及模式转换:
命令模式 输入模式 末行模式
命令模式---->输入模式:
insert
i | Insert from the front of the cursor position, and the cursor moves backward with the inserted content |
---|---|
I | Insert from before the first non-blank character in the line where the cursor is |
Add
a | Start adding from behind the cursor position, and the cursor moves backward with the inserted content |
---|---|
A | Start adding from the end of the line where the cursor is |
Start
O | Add a new line from the line below the cursor to enter the input mode |
---|---|
O | Add a new line above the line where the cursor is to enter the input mode |
输入模式----->命令模式:
ESC键
命令模式:
光标移动:上下左右键
命令模式----->末行模式:
shift+ :
末行模式---->命令模式
ESC键
翻页:
全键盘:page Down 或者Ctrl+F(向下翻页)
page UP或者Ctrl+B(向上翻页)
小键盘: Ctrl+F / Ctrl+B(同上)
行内跳转:^(shift+6) 或 数字0 或 Home 跳转至行首
$(shift+4) 或 END 跳转至行尾
行间跳转:1G,gg 跳转至文件行首
G 跳转至文件末行
#G 跳转至文件#行
Last line mode:
Save | w |
---|---|
drop out | q |
Force quit | q! |
Save and exit | wq |