18

I've been using Vim for a week now. And I've noticed something.

I have textwidth unset, and I have wrap set. Now, my question is. Currently whenever I line longer than 120 characters (window width), it takes the last character, and just like that, wraps it. So if it's in the middle of a word it looks like this:

This is a very long sen|
tence, this looks very |
strange, don't you thin|
k?                     |

BTW, the | represents the text limit, very short in this case, to prove my point. So that says what my problem is, I would like a simply solution to this, as long as I don't lose any screen real estate.

Of course, the ideal solution would output the following, without modifying the text, only the output, the text remains in one line, but it appears to be spread over several:

This is a very long    |
sentence, this looks   |
very strange, don't you|
think?                 |

Thanks for any help you can provide. :)

Extra info:

  • OS: Mac OSX Mountain Lion
  • Using MacVim

I've tried the following:

set textwidth=120

set wrap
set linebreak

set fo=1
greduan
  • 4,770
  • 6
  • 45
  • 73
  • 1
    Some of the answers to http://stackoverflow.com/q/467739/684934 look promising. (None are accepted, though.) –  Nov 08 '12 at 17:36
  • @bdares Thanks, I didn't see that one. Still, it doesn't solve my problem, none of the options. – greduan Nov 08 '12 at 17:40

2 Answers2

24
set linebreak

is enough. It doesn't work when list is on, though.

romainl
  • 186,200
  • 21
  • 280
  • 313
0

My solution to this problem was this Vim wiki page. Thanks to @romainl for convincing me to not use list.

Keith Pinson
  • 7,835
  • 7
  • 61
  • 104
greduan
  • 4,770
  • 6
  • 45
  • 73