1.在Visual模式下對選中區域批量執行寄存器q裏的命令:
:normal @q
2.進入Visual Block模式(批量刪除 x、增加 I)
Ctrl + q
3.文首gg 文尾G
4.全文按行排序且去重(實際上是使用了用管道結合的外部命令)
:%!sort|uniq
5.在當前目錄及子目錄中搜索helloworld(用:cn到下一個位置)
:vimgrep /helloworld/ **/*
6.刪除行尾多餘空格
:%s/\s$//
%表示全文,s表示搜索 /\s$表示被替換的是空格加行末 //表示替換爲空
刪除特定區域的在Visual模式下選中後輸入
:s/\s$//
update:
2014-8-6 +5 tip
2014-8-7+1 tip +update