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 S-g
, S-:
, a
, enter
, .
, 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?
G:a<CR>.
does ? because it does nothing in my vim, except to go to the last line ...<S-g>
notation, or the <kbd>.</kbd> one :)