Wednesday, August 17, 2011

Re: Wrapping relative to current indent?

Hi Tim!

On Mi, 17 Aug 2011, Tim Chase wrote:

> I'd like to be able to "set wrap linebreak" so that my long(er)
> lines of code wrap at my 80-column margin. However the wrapped
> lines display starting at the left margin. E.g.
>
> |def my_func() |
> | for thing in (1, 2,|3, 4, 5)
> | |
> ^ wrap column
>
> Setting 'wrap linebreak' wraps to look like
>
> |def my_func() |
> | for thing in (1, 2,|
> |3, 4, 5) |
>
> whereas I'm hoping for something like either wrapping to the *same*
> indent as the wrapped line,
>
> |def my_func() |
> | for thing in (1, 2,|
> | 3, 4, 5) |
>
> or even better wrapping to the same-plus-a-multiple-of-'shiftwidth':
>
> |def my_func() |
> | for thing in (1, 2,|
> | 3, 4, 5) |
>
>
> Any leads on coercing Vim to do such indented soft-wrapping (without
> inserting the literal newlines/indentation into the file)?

I am afraid, that is not possible, at least not that I know of. There is
the breakindent¹ Patch, that should do what you want, so you need to
compile your own version.

¹)https://retracile.net/wiki/VimBreakIndent

regards,
Christian

--
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: