: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 会执行一个正则表达式的命令,能删除文本里面的空行。
Vim 技巧 Vim trick
时间: 2024-12-15 11:32:21
: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 会执行一个正则表达式的命令,能删除文本里面的空行。
Vim 技巧 Vim trick