Wikia

Vim Tips Wiki

Easily switch between two styles of color scheme

Talk0
1,612pages on
this wiki
Revision as of 05:59, July 13, 2012 by JohnBot (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Tip 955 Printable Monobook Previous Next

created 2005 · complexity basic · author Georg Dahn · version 6.0


Pan Shizhu's color scheme ps_color script#760 supports two styles, a cool (dark) and a warm (light) style. If you want to switch between these styles by just a single key stroke, you may define the following function in your vimrc:

function! s:SwitchPSCStyle()
  if exists('g:psc_style')
    if g:psc_style == 'cool'
      let g:psc_style = 'warm'
    elseif g:psc_style == 'warm'
      let g:psc_style = 'cool'
    endif
  else
    let g:psc_style = 'warm'
  endif
  colorscheme ps_color
endfunction
map <silent> <F6> :call <SID>SwitchPSCStyle()<CR>

CommentsEdit

 TO DO 

  • Decide what to do with above SwitchPSCStyle function (is it worth keeping?).
  • Other content that was in this tip has been merged to Switch color schemes. If remove tip 955, replace it with a redirect to 341.

Around Wikia's network

Random Wiki