colorscheme-statusline.vim 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. " Colour Scheme & Status Line
  2. "
  3. " Available colour schemes:
  4. " - flattened (solarized clone)
  5. " - neonwave
  6. " Fix wrong background colour in tmux, when using 256 colours, and when vim
  7. " changes the background colour.
  8. " http://sunaku.github.io/vim-256color-bce.html
  9. set t_ut=
  10. " Comment this out to use proper solarized colours, after the terminal emulator
  11. " palette is properly set up.
  12. let g:solarized_termcolors=256
  13. " Status line defaults.
  14. let g:airline_powerline_fonts = 1
  15. set laststatus=2 " always show the status line.
  16. set noshowmode " hide modes e.g. --INSERT-- with themed status lines.
  17. set showcmd " display partial commands on the last line
  18. function! Dark()
  19. set background=dark
  20. colorscheme solarized
  21. call SetTheme('powerlineish')
  22. highlight SignColumn ctermbg=235
  23. endfunction
  24. function! Light()
  25. set background=light
  26. colorscheme solarized
  27. call SetTheme('powerlineish')
  28. endfunction
  29. function! Neon()
  30. set background=light
  31. colorscheme neonwave
  32. call SetTheme('surarken')
  33. endfunction
  34. function! SetTheme(name)
  35. " Airline functions are not available at vim start.
  36. if exists(':AirlineTheme')
  37. execute 'AirlineTheme' a:name
  38. else
  39. let g:airline_theme = a:name
  40. endif
  41. endfunction
  42. " General Colorscheme overrides
  43. autocmd ColorScheme * call CustomHighlights()
  44. function! CustomHighlights()
  45. highlight ExtraWhitespace ctermbg=red guibg=red
  46. " Mute spellcheck highlighting
  47. " Highlights must be cleared first, or `link` will fail.
  48. highlight clear SpellBad | highlight SpellBad cterm=underline
  49. highlight clear SpellCap | highlight link SpellCap SpellBad
  50. highlight clear SpellLocal | highlight link SpellLocal SpellBad
  51. highlight clear SpellRare | highlight link SpellRare SpellBad
  52. endfunction
  53. call Dark()