Loading ...
Sorry, an error occurred while loading the content.
 

Column 80 edge/guide

Expand Messages
  • Kevin L'Huillier
    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
    Message 1 of 3 , Apr 2, 2004
      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
      I m not sure I see the need for CursorHold in there, unless you use :match elsewhere in your work, too. (I don t, so have a simple :match.) The only thing I
      Message 2 of 3 , Apr 2, 2004
        I'm not sure I see the need for CursorHold in there, unless you use :match elsewhere in your work, too. (I don't, so have a simple :match.)

        The only thing I have been able to do effectively is to do something like:

        execute 'set lines=9999 columns=' . (&tw + (&nu ? 8 : 0) + 2)

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

        Salman.

        > -----Original Message-----
        > From: Kevin L'Huillier [mailto:klhuillier@...]
        > Sent: Friday, April 02, 2004 5:13 PM
        > To: vim@...
        > Subject: 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.
        >
        >
      • Antoine J. Mechelynck
        ... Beware: some files set &tw to 0 (meaning no fixed text width) by means of modelines or maybe filetype-plugins. I suggest replacing &tw above by something
        Message 3 of 3 , Apr 2, 2004
          Halim, Salman <salman@...> wrote:
          > I'm not sure I see the need for CursorHold in there, unless you use
          > :match elsewhere in your work, too. (I don't, so have a simple
          > :match.)
          >
          > The only thing I have been able to do effectively is to do something
          > like:
          >
          > execute 'set lines=9999 columns=' . (&tw + (&nu ? 8 : 0) + 2)

          Beware: some files set &tw to 0 (meaning no fixed text width) by means of
          modelines or maybe filetype-plugins. I suggest replacing &tw above by
          something like (&tw < 60 ? 60 : &tw) to avoid making the vim window
          ridiculously narrow.

          >
          > 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. . .
          >
          > Salman.
          >
          > > -----Original Message-----
          [...]

          Best regards,
          Tony.
        Your message has been successfully submitted and would be delivered to recipients shortly.