Vim¶
Reference¶
- Vim | Albert Wu
- Vim - CS自学指南
- Editors (Vim) - TMSOYCSE
- Unix Vi Guide
- Vim Cheat Sheat for Programmers by Michael Pohoreski
1. Vim Editing Modes¶
- normal mode
- insert mode
- command mode
- visual mode
Some useful Vim commands¶
Command | Explanation |
---|---|
[ESC] :tabe <filepath> |
Opens the file at filepath in a new tab. You can use [Tab] for autocompletion |
[Esc] :tabn |
Go to the next tab in the tab bar |
[Esc] :tabp |
Go to the previous tab in the tab bar |
Vim Tutor¶
Multiple Windows¶
CTRL-w
+ one of thehjkl
keys - To navigate between windows.
常用 Vim 命令总结¶
复制当前文件全部内容¶
ggVG
- 将光标移动到文件的第一行(gg
),然后选择整个文件的内容(V
),并将光标移动到文件的最后一行(G
)。
"+y
- 将复制选择的内容到系统剪贴板。
Ctrl + Shift + V
或右键点击粘贴 - 粘贴内容