I currently run a series of commands on any file I am working on to compress the lines. That series is -
G:a PRESS ENTER KEY . :g/^./ .,/^$/-1 join
So I press
., then run that regular expression. This joins my lines.
function! CrunchLines() exec G exec : exec a exec return . :g/^./ .,/^$/-1 join endfu com! CRUNCH call CrunchLines()
How do you just run vim commands inside of a function?