How do I make Gvim word wrap in such a way that doesn't break words in the middle?
+1
A:
:set tw=78
sets the text width to 78 characters. You can use "[movement]gq" to re-wrap some text.
Paul Tomblin
2009-04-13 15:01:44
This is not exactly what I had in mind. If I resize the window it still breaks the words. I want the same behavior you would expect in Windows text editors.
Epsilon Vector
2009-04-13 15:06:29
+1
A:
You can
:set nowrap
to just let huge lines scroll of the edge of your screen. But tw is probably the better way to go.
ddvlad
2009-04-13 15:06:39
A:
You can also use wrapmargin, which the manual defines as:
Number of characters from the right window border where wrapping
starts. When typing text beyond this limit, an <EOL> will be inserted
and inserting continues on the next line.
Peter
2009-04-13 15:14:00
I'm confused by this option: I don't want my current terminal width to determine how the file is saved.
Roger Pate
2010-07-12 03:36:21
+9
A:
Looks like there is a solution online after all.
:set formatoptions=l
:set lbr
Link: http://vim.wikia.com/wiki/Word_wrap_without_line_breaks
Epsilon Vector
2009-04-13 15:16:15
For anyone else having problems figuring out why linebreak/lbr won't work, double check that you haven't turned list on (i.e. :set nolist); it disables linebreak. (D'oh! Pulled out some hair while searching the docs because of that.)
Roger Pate
2010-07-10 22:54:03