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

60055Re: color scheme switcher

Expand Messages
  • Scott LaBounty
    Jul 5, 2005
    • 0 Attachment
      Tim,

      I just tried this out with Window XP and I get "E185: Cannot find color
      scheme C:/Program Files/vim/vim63/colors/blue.vim". If I go ahead and
      just do a "colorscheme blue then following that the switch will work.
      Any thoughts?

      Scott LaBounty
      Nexa Technologies, Inc.

      Tim Chase wrote:

      >> Could a button be mapped to rotate through installed color
      >> schemes? Is vim aware of the files in ~/.vim, ~/.vim/colors
      >> etc?
      >
      >
      > Why, of course! This is vim :)
      >
      > nnoremap <f4> :exec "colorscheme
      > ".substitute(expand($VIMRUNTIME."/colors/*.vim"),
      > '.*[/\\]'.colors_name.'\.vim\c[[:cntrl:]]*[^[:cntrl:]]*[/\\]\([^.]*\).*',
      > '\1', 'g')<cr>
      >
      > Note 1: this is all one line.
      > Note 2: though you may not be able to see it, there's a space after
      > that last "<cr>" making it "<cr> " so that it dismisses the "press
      > return to continue" sort of prompt that comes up.
      >
      > It doesn't wrap, and it doesn't do any initialization, so you'll have
      > to prime it by setting your colorscheme to the first one in the list
      > by doing
      >
      > :colorscheme <tab>
      >
      > where you actually hit <tab> there. This should snag the first one it
      > finds. Once it hits the end of the list, it will just keep that one.
      > Not very exciting.
      >
      > I did this on Win32 vim, which only has one color location. However, a
      > little manipulation should be able to build a combination of multiple
      > locations...changing the
      >
      > expand($VIMRUNTIME."/colors/*.vim")
      >
      > to be something like
      >
      > expand($VIMRUNTIME."/colors/*.vim")."\n".expand($OTHER_PATH...)
      >
      > If you need that monstrosity broken down, let me know and I'll try and
      > shed a little light on it :)
      >
      > -tim
      >
      >
      >
      >
      >
      >
      >
    • Show all 13 messages in this topic