public
Created

SoftWrap vim command

  • Download Gist
softwrapcmd.vim
VimL
1 2 3 4 5 6 7
" Turn hard wrapped text into soft wrapped.
" This command will join all lines within a range that are not separated
" by empty lines. Automatic word wrap must be off (set fo-=a).
" Useful if you need to copy and paste into a word processor.
command! -range=% SoftWrap
\ <line2>put _ |
\ <line1>,<line2>g/.\+/ .;-/^$/ join |normal $x

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.