首页 > 代码库 > Vim 技巧 Vim trick

Vim 技巧 Vim trick

:g/^$/d:g will execute a command on lines which match a regex. The regex is blank line and the command is :d (delete)

 g 会执行一个正则表达式的命令,能删除文本里面的空行。