Column 80 edge/guide
- Some development environment editors will show a vertical bar beside
column 80 to allow users to visibly see the column without restricting
the width of their editor. I managed to partly create this effect by
putting this in ~/.vimrc:
highlight LineOverflow guibg=#202060 guifg=white
autocmd CursorHold * match LineOverflow "\%81v.*"
That is probably not a smart way to do things. I don't mind using it,
but it wasn't quite what I had in mind. Is there a way to affect the
columns past 80, not just text in those columns? The ideal result would
be a visible edge on the screen.
- Halim, Salman <salman@...> wrote:
> I'm not sure I see the need for CursorHold in there, unless you useBeware: some files set &tw to 0 (meaning no fixed text width) by means of
> :match elsewhere in your work, too. (I don't, so have a simple
> The only thing I have been able to do effectively is to do something
> execute 'set lines=9999 columns=' . (&tw + (&nu ? 8 : 0) + 2)
modelines or maybe filetype-plugins. I suggest replacing &tw above by
something like (&tw < 60 ? 60 : &tw) to avoid making the vim window
> Sets the lines to the maximum that'll fit on-screen and the columns
> to 'textwidth' + 8 if line-number is on + 2 for signs (I use
> ShowMarks). Combine this with a command that changes your textwidth
> and start using that instead of 'set tw=' and it'll always keep the
> window size to precisely what your line length should be. . .
> > -----Original Message-----