Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Vim] Left margin for wrap

0 views
Skip to first unread message

David Trimboli

unread,
Dec 16, 2009, 11:16:24 AM12/16/09
to
I see that one cannot put a tab in the showbreak option. I've got a
two-column tabular table with long lines in the second column. I'd like
to use wrap and linebreak to keep the text readable, but I'd like to
make the long lines visually stay in the second column. Since I can't
set showbreak equal to a tab, is this possible in some other way?

--
David Trimboli
Windows Systems Analyst
Cold Spring Harbor Laboratory

Antony Scriven

unread,
Dec 16, 2009, 11:47:55 AM12/16/09
to
David Trimboli wrote:

> I see that one cannot put a tab in the showbreak option.

> [...]

Use spaces. --Antony

David Trimboli

unread,
Dec 16, 2009, 2:37:14 PM12/16/09
to

Yeeeeeeesss... but that doesn't consider the possibility of changing the
tab size.

Still, I tried it and found that regular spaces do not work. Spaces, and
anything appearing after them, do not show up. " " results in no
showbreak; "+ " results in a showbreak of "+", and "+ +" results in a
showbreak of "+". This is odd, since the manual says you can include spaces.

I compromised and entered eight no-break spaces, which worked.

Gary Johnson

unread,
Dec 16, 2009, 2:56:21 PM12/16/09
to
David Trimboli <trim...@cshl.edu> wrote:
> On 12/16/2009 11:47 AM, Antony Scriven wrote:
> > David Trimboli wrote:
> >
> > > I see that one cannot put a tab in the showbreak option.
> > > [...]
> >
> > Use spaces. --Antony
>
> Yeeeeeeesss... but that doesn't consider the possibility of changing the
> tab size.
>
> Still, I tried it and found that regular spaces do not work. Spaces, and
> anything appearing after them, do not show up. " " results in no
> showbreak; "+ " results in a showbreak of "+", and "+ +" results in a
> showbreak of "+". This is odd, since the manual says you can include spaces.
>
> I compromised and entered eight no-break spaces, which worked.

Spaces in the rhs of set assignments need to be quoted with backslashes.
The following all work for me using vim 7.2.148 on Linux.

:set showbreak=+\ +
:set showbreak=\ \ \ \ \ \ \ \

Note that the last character of the second set is a space. You could
also use let instead of set, then you could enclose the rhs in quotation
marks:

:let &showbreak="+ +"
:let &showbreak=" "

--
Gary Johnson

David Trimboli

unread,
Dec 16, 2009, 3:39:44 PM12/16/09
to
On 12/16/2009 2:56 PM, Gary Johnson wrote:
> David Trimboli<trim...@cshl.edu> wrote:
>> On 12/16/2009 11:47 AM, Antony Scriven wrote:
>>> David Trimboli wrote:
>>>
>>> > I see that one cannot put a tab in the showbreak option.
>>> > [...]
>>>
>>> Use spaces. --Antony
>>
>> Yeeeeeeesss... but that doesn't consider the possibility of changing the
>> tab size.
>>
>> Still, I tried it and found that regular spaces do not work. Spaces, and
>> anything appearing after them, do not show up. " " results in no
>> showbreak; "+ " results in a showbreak of "+", and "+ +" results in a
>> showbreak of "+". This is odd, since the manual says you can include spaces.
>>
>> I compromised and entered eight no-break spaces, which worked.
>
> Spaces in the rhs of set assignments need to be quoted with backslashes.
> The following all work for me using vim 7.2.148 on Linux.
>
> :set showbreak=+\ +
> :set showbreak=\ \ \ \ \ \ \ \

Aha! Got it.

0 new messages