VIM:How to delete blank lines in vim?

Delete all blank line :g/^\s*$/d
Delete only successive multi blank lines (reduce them to a single blank line) and leaving single blank lines intact :g/^\_$\n\_^$/d
Here's the easiest one :v/\S/d
Deletes all the lines that don't have a number or letter, it deleted all the blank lines :%s/^[^a-zA-Z0-9]$\n//ig
 
posted @ 2018-06-05 20:57  xinyueliu  阅读(38)  评论(0)    收藏  举报