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. 🙂
so is there a way to have j/k move you up and down within the wrapped line?
Not that I know of, but I usually use the w and b keys in command mode to move quickly around a line.
Stephen: Use `gj` and `gk` to move up and down a wrapped line.
Jon-Michael: Thanks so much! that’s perfect, and you can vimrc the heck out of it, even:
nnoremap k gk
nnoremap j gj
Pingback: Blasphemer! DOSBox and Word 5.5 « Motho ke motho ka botho
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.
I am glad you enjoy it. And don’t worry — half the stuff I write about, I don’t fully understand either. 😳