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

Re: Color schemes with colorcolumn support?

Expand Messages
  • 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 1 of 7 , Jun 22, 2013
    • 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 2 of 7 , Jun 23, 2013
      • 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.