Wednesday, August 17, 2011

Re: user specified wrapping w/o linebreak?

On 2011-08-17, ninjaaron wrote:
> I've started using vim in the tty for creating prose (as opposed to code)
> without any distractions. This works fairly well, but there is a problem
> with wrapping. Obviously, having lines go all the way across the screen is
> difficult to read. I need the text to wrap at somewhere around 70-80
> characters.
>
> I've tried doing this with the textwidth (tw) and wrapmargin (wm) options.
> This works well within the buffer, but it creates line breaks, which is a
> pain if I want to move the text into a WYSIWYG editor or post it on my blog.
>
> Is there a way to make the text wrap within the buffer at 72 characters
> without actually creating a line break?

Vim only wraps lines in that manner at the window margin, so the
only way to make Vim wrap long lines at 72 columns without inserting
line breaks is to make the window 72 columns wide. You can do this
with the following commands.

:rightb vnew
<C-W><C-W>
72<C-W>|

Where <C-W> means to type a literal Ctrl-W. You might also want to

:set linebreak

to make the wrapping occur at word boundaries. See

:help :vnew
:help :rightb
:help CTRL-W_CTRL-W
:help CTRL-W_bar
:help 'linebreak'

Regards,
Gary

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: