What command can I run to remove blank lines in Vim?
This function only remove two or more blank lines, put the lines below in your vimrc, then use \d to call function
fun! DelBlank()
let _s=@/
let l = line(".")
let c = col(".")
:g/^\n\{2,}/d
let @/=_s
call cursor(l, c)
endfun
map <special> <leader>d :keepjumps call DelBlank()<cr>
:v/./d
or
:g/^$/d
or
:%!cat -s