colortest.vim 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. " Vim script for testing colors
  2. " Maintainer: Bram Moolenaar <Bram@vim.org>
  3. " Contributors: Rafael Garcia-Suarez, Charles Campbell
  4. " Last Change: 2008 Jun 04
  5. " edit this file, then do ":source %", and check if the colors match
  6. " black black_on_white white_on_black
  7. " black_on_black black_on_black
  8. " darkred darkred_on_white white_on_darkred
  9. " darkred_on_black black_on_darkred
  10. " darkgreen darkgreen_on_white white_on_darkgreen
  11. " darkgreen_on_black black_on_darkgreen
  12. " brown brown_on_white white_on_brown
  13. " brown_on_black black_on_brown
  14. " darkblue darkblue_on_white white_on_darkblue
  15. " darkblue_on_black black_on_darkblue
  16. " darkmagenta darkmagenta_on_white white_on_darkmagenta
  17. " darkmagenta_on_black black_on_darkmagenta
  18. " darkcyan darkcyan_on_white white_on_darkcyan
  19. " darkcyan_on_black black_on_darkcyan
  20. " lightgray lightgray_on_white white_on_lightgray
  21. " lightgray_on_black black_on_lightgray
  22. " darkgray darkgray_on_white white_on_darkgray
  23. " darkgray_on_black black_on_darkgray
  24. " red red_on_white white_on_red
  25. " red_on_black black_on_red
  26. " green green_on_white white_on_green
  27. " green_on_black black_on_green
  28. " yellow yellow_on_white white_on_yellow
  29. " yellow_on_black black_on_yellow
  30. " blue blue_on_white white_on_blue
  31. " blue_on_black black_on_blue
  32. " magenta magenta_on_white white_on_magenta
  33. " magenta_on_black black_on_magenta
  34. " cyan cyan_on_white white_on_cyan
  35. " cyan_on_black black_on_cyan
  36. " white white_on_white white_on_white
  37. " white_on_black black_on_white
  38. " grey grey_on_white white_on_grey
  39. " grey_on_black black_on_grey
  40. " lightred lightred_on_white white_on_lightred
  41. " lightred_on_black black_on_lightred
  42. " lightgreen lightgreen_on_white white_on_lightgreen
  43. " lightgreen_on_black black_on_lightgreen
  44. " lightyellow lightyellow_on_white white_on_lightyellow
  45. " lightyellow_on_black black_on_lightyellow
  46. " lightblue lightblue_on_white white_on_lightblue
  47. " lightblue_on_black black_on_lightblue
  48. " lightmagenta lightmagenta_on_white white_on_lightmagenta
  49. " lightmagenta_on_black black_on_lightmagenta
  50. " lightcyan lightcyan_on_white white_on_lightcyan
  51. " lightcyan_on_black black_on_lightcyan
  52. " Open this file in a window if it isn't edited yet.
  53. " Use the current window if it's empty.
  54. if expand('%:p') != expand('<sfile>:p')
  55. let s:fname = expand('<sfile>')
  56. if exists('*fnameescape')
  57. let s:fname = fnameescape(s:fname)
  58. else
  59. let s:fname = escape(s:fname, ' \|')
  60. endif
  61. if &mod || line('$') != 1 || getline(1) != ''
  62. exe "new " . s:fname
  63. else
  64. exe "edit " . s:fname
  65. endif
  66. unlet s:fname
  67. endif
  68. syn clear
  69. 8
  70. while search("_on_", "W") < 55
  71. let col1 = substitute(expand("<cword>"), '\(\a\+\)_on_\a\+', '\1', "")
  72. let col2 = substitute(expand("<cword>"), '\a\+_on_\(\a\+\)', '\1', "")
  73. exec 'hi col_'.col1.'_'.col2.' ctermfg='.col1.' guifg='.col1.' ctermbg='.col2.' guibg='.col2
  74. exec 'syn keyword col_'.col1.'_'.col2.' '.col1.'_on_'.col2
  75. endwhile
  76. 8,54g/^" \a/exec 'hi col_'.expand("<cword>").' ctermfg='.expand("<cword>").' guifg='.expand("<cword>")| exec 'syn keyword col_'.expand("<cword>")." ".expand("<cword>")
  77. nohlsearch