Vim: Soft Wrap

Here's another Vim tip, which I'm surprised it took me so long to find out. To make Vim "soft wrap" text, like Microsoft Word does, use ":set wrap linebreak textwidth=0".

Comments

NoahGift said…
dude you rock! I was just thinking...hmmm I bet Shannon knows and boom...gotcha on google :)
hahaha

That's awesome!
sam said…
Thanx dude.I love this feature.
Nick said…
thnx!
Anonymous said…
# aptitude remove gedit

Finally! I can now use vim for prose as well as code. Cheers!
Hahaha, nice ;)

The only thing I wish is that it would treat soft wrapped text the way Emacs and Microsoft Word do. I.e., if you press up (i.e. k), it should go up a line on the screen, whether or not there was a \n involved. Oh well. I wonder if there's a setting for that too.
silwilin said…
thanks!!!
@Shannon -jj Behrens:
:map j gj
:map k gk
:map [Up] gk
:map [Down] gj

Just use '<' '>' instead of '[' and ']'
silwilin, thanks!!!
ke said…
The quality of my life has just improved drastically. Thanks silwilin and Shannon!
Anonymous said…
how to you revert the command?
Opening a new window or tab is probably the fastest way.
Sand said…
Thanks a ton, this really helped.
Matt said…
Thanks this was very helpful.