删除含有“#”开头的行
:% g/^#/d
删除空行
:% g/^$/d
删除不含该字符串的行
:% v/pattern/d
文章来源:http://luxiaok.blog.51cto.com/2177896/965465