Skip to content

Instantly share code, notes, and snippets.

@alols
Created December 1, 2011 21:38
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save alols/1420072 to your computer and use it in GitHub Desktop.
SoftWrap vim command
" 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment