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

57974Re: Patch to allow ctermfg or bg values as #rrggbb

Expand Messages
  • Ingo Karkat
    Jul 24, 2010
      On 21-Jul-2010 20:57, Matt Wozniski wrote:
      > The down side is that it's a bit slow (as Dominique pointed out), but
      > I have a version in my sandbox that should hopefully help a bit with
      > that.

      If you don't change your colorscheme often, CSApprox.vim (again, thanks Matt for
      this wonderful plugin!) allows to take a static snapshot, which avoids the
      runtime penalty of translating all colors on each Vim launch; instead, only the
      generated snapshot is sourced.

      I have my own colorscheme, and here's how I generate a new snapshot whenever I
      have modified it (notice how I have put CSApprox in .vim/, not .vim/plugin/, so
      it's only sourced on-demand for this one-time conversion):

      gvim -c "runtime CSApprox.vim|CSApproxSnapshot!
      ~/.vim/colors/ingo-cterm.vim|quit"

      In my .vimrc, the following fragment detects a color terminal and then sources
      the snapshot. (Though this isn't strictly necessary, it falls back to the
      original, handwritten colorscheme when run in a plain terminal or the GUI.)

      let g:color_terminal = ! has('gui_running') && &t_Co >= 88
      if g:color_terminal
      " There may exist a high color snapshot of my colorscheme generated by
      " CSApprox.vim.
      try
      colorscheme ingo-cterm
      catch /^Vim\%((\a\+)\)\=:E185/ " catch error E185: Cannot find color scheme
      colorscheme ingo
      endtry
      else
      colorscheme ingo
      endif

      This works well for me, so I would recommend such an approach to try in case
      you're concerned about the startup performance.

      -- regards, ingo
      --
      -- Ingo Karkat -- /^-- /^-- /^-- /^-- /^-- /^-- http://ingo-karkat.de/ --
      -- http://vim.sourceforge.net/account/profile.php?user_id=9713 --

      --
      You received this message from the "vim_dev" 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
    • Show all 33 messages in this topic