vim 基础操作

下面的命令都要先按esc退出编辑模式

save file

:w    save but not quit

:wq    save and quit

:q!     not save and quit

cut and paste

dd    cut the line

ndd            cut the current line and the following n-1 lines

p                paste 注意粘贴的时候是从当前行的下一行开始粘贴

fold and unfold

zc    fold

zo             unfold

原文地址:https://www.cnblogs.com/zhanchao/p/7509492.html