vi ~/.vimrc set fileencodings=utf-8,gbk set termencoding=utf-8 set encoding=utf-8
vim的多行移動
一、連續的十幾行到50行內的左右移動: 1. 第m行到第n行右移一個tab :m,n> 2. 第m行到第n行左移一個tab :m,n< 二、連續的I行的左右移動(I > 100): 向左: 1.移動到要處理的首行,輸入ma 2.移動到要處理的尾行,輸入<'a 向右,即將第二個命令中的 '<' 改為 '>'即可。
vim 中刪除多行
單行刪除,:1(待刪除行)d
多行刪除 ,:1,10d
多行注釋
:.,+499 s/^/#/g
刪除行首空格
:%s/ *//
每行前面加入一個空格
:%s/^/ /