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

Re: Color schemes with colorcolumn support?

Expand Messages
  • Bee
    ... This is in .vimrc: if exists( +colorcolumn ) set colorcolumn=+1 textwidth+n ? set colorcolumn=64,72,80 specific columns hi ColorColumn NONE
    Message 1 of 7 , Jun 21 5:39 PM
    • 0 Attachment
      On Friday, June 21, 2013 1:33:49 PM UTC-7, Sean Hammond wrote:
      > Anyone know any good color schemes with colorcolumn support? Most vim
      >
      > color schemes seem to have been written before the colorcolumn option
      >
      > was added, and the colorcolumn tends to show in a color that clashes
      >
      > really badly with the rest of the theme (e.g. bright red).
      >
      >
      >
      > I have a lot of Vim themes installed, and by the test of grepping my
      >
      > colors dir for colorcolumn I found only these ones that seem to define a
      >
      > color for it (admittedly this test may give false negatives):
      >
      >
      >
      > Dark:
      >
      >
      >
      > jellybeans
      >
      > codeschool
      >
      > distinguished
      >
      > vividchalk
      >
      >
      >
      > Light: mayansmoke
      >
      >
      >
      > Supports both dark or light:
      >
      >
      >
      > hemisu
      >
      >
      >
      > base16: There's a lot of variations of this theme, unfortunately they
      >
      > don't seem to work at all in my terminal Vim.
      >
      >
      >
      > From what I've seen so far, Hemisu is pretty good, I recommend it.
      >
      >
      >
      > An alternative solution would be to set the color of the colorcolumn
      >
      > based on some other color from the theme, so it works with themes that
      >
      > don't know about colorcolumn. Set it to the highlight current line
      >
      > color, which a lot more themes seem to have, or to the background color
      >
      > but 10% darker or lighter. I don't know how to do either of these things
      >
      > though.

      This is in .vimrc:

      if exists("+colorcolumn")
      set colorcolumn=+1 " textwidth+n
      "? set colorcolumn=64,72,80 " specific columns
      hi ColorColumn NONE ctermbg=Cyan
      endif

      This is in .gvimrc:

      hi ColorColumn NONE guibg=Cyan

      :help 'colorcolumn'

      Some options to try:

      :hi! link ColorColumn StatusLine

      :hi! link ColorColumn CursorLine

      Bill

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

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • seanh
      ... That s a really nice color scheme (with colorcolumn support), thanks! -- -- You received this message from the vim_use maillist. Do not top-post! Type
      Message 2 of 7 , Jun 22 3:58 AM
      • 0 Attachment
        > my favorite has been biogoo for a long time

        That's a really nice color scheme (with colorcolumn support), thanks!

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

        ---
        You received this message because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • seanh
        ... This works, thanks, I tried a few and it seems most themes look reasonable with one or the other of these `:hi! link` commands. I also use this, to
        Message 3 of 7 , Jun 22 4:12 AM
        • 0 Attachment
          > > An alternative solution would be to set the color of the colorcolumn
          > > based on some other color from the theme, so it works with themes that
          > > don't know about colorcolumn. Set it to the highlight current line
          > > color, which a lot more themes seem to have, or to the background color
          > > but 10% darker or lighter. I don't know how to do either of these things
          > > though.
          >
          > (snip)
          >
          > Some options to try:
          >
          > :hi! link ColorColumn StatusLine
          >
          > :hi! link ColorColumn CursorLine

          This works, thanks, I tried a few and it seems most themes look
          reasonable with one or the other of these `:hi! link` commands.

          I also use this, to highlight all columns from 80 onwards with the
          ColorColumn background color, rather than just a single column, I think
          that looks nicer:

          let &colorcolumn=join(range(80,999),",")

          (from: http://stackoverflow.com/a/13731714).

          If the theme defines a CursorLine background color, that will likely be
          the best color for ColorColumn as well. If it doesn't have a CursorLine
          background color (many themes don't) then StatusLine seems a good
          fallback. I think the algorithm should be:

          if cursorline is activated:
          if the colorscheme does not define a ColorColumn color:
          if it defines a CursorLine background color:
          :hi! link ColorColumn background CursorLine
          else if it defines a StatusLine background color:
          :hi! link ColorColumn StatusLine
          else:
          Print out a warning.

          And this function should be automatically executed whenever cursorline
          is turned on and whenever the colorscheme is changed.

          I may try and implement this at some point.

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

          ---
          You received this message because you are subscribed to the Google Groups "vim_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • seanh
          ... There is an autocommand event for ColorScheme. There isn t one for when cursorline is turned on but I don t think that would be needed, actually. The
          Message 4 of 7 , Jun 22 1:48 PM
          • 0 Attachment
            > If the theme defines a CursorLine background color, that will likely be
            > the best color for ColorColumn as well. If it doesn't have a CursorLine
            > background color (many themes don't) then StatusLine seems a good
            > fallback. I think the algorithm should be:
            >
            > if cursorline is activated:
            > if the colorscheme does not define a ColorColumn color:
            > if it defines a CursorLine background color:
            > :hi! link ColorColumn background CursorLine
            > else if it defines a StatusLine background color:
            > :hi! link ColorColumn StatusLine
            > else:
            > Print out a warning.
            >
            > And this function should be automatically executed whenever cursorline
            > is turned on and whenever the colorscheme is changed.

            There is an autocommand event for ColorScheme. There isn't one for
            'when cursorline is turned on' but I don't think that would be needed,
            actually. The problem is that I can't see any way to ask Vim
            "does the current color scheme define a ColorColumn background color?"

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

            ---
            You received this message because you are subscribed to the Google Groups "vim_use" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • Ben Fritz
            ... You don t need to know. Just use hi def instead of plain hi and it won t override anything set previously. -- -- You received this message from the
            Message 5 of 7 , Jun 23 7:41 PM
            • 0 Attachment
              On Saturday, June 22, 2013 3:48:26 PM UTC-5, Sean Hammond wrote:
              >
              > The problem is that I can't see any way to ask Vim
              >
              > "does the current color scheme define a ColorColumn background color?"


              You don't need to know. Just use "hi def" instead of plain "hi" and it won't override anything set previously.

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

              ---
              You received this message because you are subscribed to the Google Groups "vim_use" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            Your message has been successfully submitted and would be delivered to recipients shortly.