Proper word-wrapping in vim

That last post took hours to put together, so this one will be short and brief. A long time ago I found two settings for vim that, when used in conjunction, give me the word wrapping I need when I compose these posts from within Charm. I never made a note of them, which is bad form.

The problem is something I’ve talked about before, so I’ll spare you the long and boring reason for needing that behavior. Under Crux, the plain-jane vim that gets built doesn’t word-wrap; instead, words are simply broken at the end of the line. Nothing wrong with that, but with

set formatoptions=l
set lbr

in my .vimrc, words break at spaces or hyphens, and links break at slashes or hyphens. It’s a very nice adjustment, particularly if you want vim to behave a little more like a word processor, and not so much like a text editor. Not that there’s anything wrong with that. 🙂

7 thoughts on “Proper word-wrapping in vim

  1. Pingback: Blasphemer! DOSBox and Word 5.5 « Motho ke motho ka botho

  2. Winston

    How is it that I spent hours after a vim tutorial trying to figure out how to do just this, and now, months later, finally stumble upon it?

    Love this blog, by the way. Can’t understand half the stuff you’re talking about but the other half has come in handy, particularly with my ten year old Sony Vaio.

    Reply

Leave a comment