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

Visible wrap column with gVim?

7 views
Skip to first unread message

Ciaran McCreesh

unread,
Jul 21, 2003, 10:14:51 PM7/21/03
to
Hi,

Is there a way to get gVim to show where wrapmargin is visually? I'm
thinking a line of |s down the screen or something... I'm editing a
number of files which need to be kept below 80 columns where possible,
but forcing a wrap isn't possible because occasionally I go over...

Cheers,
--
Ciaran McCreesh
mail: ciaranm*firedrop#org#uk


Daniel Albuschat

unread,
Jul 22, 2003, 1:07:54 AM7/22/03
to
Ciaran McCreesh wrote:

> Is there a way to get gVim to show where wrapmargin is visually? I'm
> thinking a line of |s down the screen or something... I'm editing a
> number of files which need to be kept below 80 columns where possible,
> but forcing a wrap isn't possible because occasionally I go over...

This is not possible, afaik.
But try to just resize your terminal to that width.

cu, Daniel

--
eat(this); // delicious suicide

Juergen Graefe

unread,
Jul 22, 2003, 3:47:00 AM7/22/03
to
On Tue, 22 Jul 2003 03:14:51 +0100, Ciaran McCreesh wrote:

> Is there a way to get gVim to show where wrapmargin is visually? I'm
> thinking a line of |s down the screen or something... I'm editing a
> number of files which need to be kept below 80 columns where possible,
> but forcing a wrap isn't possible because occasionally I go over...

I somewhere found a few lines for your .vimrc:

----- cut here -----
hi LineLenWarn ctermfg=yellow cterm=none
hi LineLenErr ctermfg=red cterm=none
syn match LineLenWarn /\%>80v./
syn match LineLenErr /\%>90v./
----- cut here -----

This will define two new highlighting types. The first colors all
characters in the columns 80-89 and the second all characters right of
them. You have to turn con syntax highlighting.

I had some problems with that (which i don't know anymore), but maybe it
will work for you.

greetings,
Juergen

Peter Karp

unread,
Jul 24, 2003, 3:11:31 AM7/24/03
to
Ciaran McCreesh <dev...@firedrop.org_uk> wrote:

> Hi,
>
> Is there a way to get gVim to show where wrapmargin is visually?

" aftereight(y) highlights text in yellow which is longer
" then 70 chars and in red when the text is longer than 80 chars
" by Noel Henson <no...@noels-lab.com>
" Message-ID: <KQRx9.106682$wG.4...@rwcrnsc51.ops.asp.att.net>
:syn match After70 /\%>70v./
:syn match After80 /\%>79v./
: hi After70 guibg=yellow
: hi After80 guibg=red


--
Peter

Peppe

unread,
Jul 24, 2003, 4:07:21 PM7/24/03
to
Juergen Graefe wrote:
> On Tue, 22 Jul 2003 03:14:51 +0100, Ciaran McCreesh wrote:

> > Is there a way to get gVim to show where wrapmargin is visually? I'm
> > thinking a line of |s down the screen or something... I'm editing a
> > number of files which need to be kept below 80 columns where possible,
> > but forcing a wrap isn't possible because occasionally I go over...

> I somewhere found a few lines for your .vimrc:

> ----- cut here -----
> hi LineLenWarn ctermfg=yellow cterm=none
> hi LineLenErr ctermfg=red cterm=none
> syn match LineLenWarn /\%>80v./
> syn match LineLenErr /\%>90v./
> ----- cut here -----

If you can live with the consequences of syntax highlighting getting
confused, I guess that is fine.

I'd recommend :match for this. The following would highlight characters
in column 81 through 90:

:match Todo /\%>80v\%<91v./

As you cannot use multiple :match commands, everything after the
highlighted characters will not be highlighted, though. Except for white
space, it should be clear enough that they are there, though.

If using :match, I'd recommend setting the 'list' option and tweak
'listchars' to mark the end of line somehow.

Peppe
--
se nocp cpo=BceFsx!$ sh=/bin/sh hid bs=2 ic scs hls ai isf-==
filetype plugin indent on | syn on | se lz ls=2 ru so=4
cno <C-A> <C-B>
omap S V/\n^-- $\\|\%$/<CR>

0 new messages