dark.vim 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. " MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
  2. " vim: et ts=2 sts=2 sw=2 tw=80
  3. scriptencoding utf-8
  4. " Airline themes are generated based on the following concepts:
  5. " * The section of the status line, valid Airline statusline sections are:
  6. " * airline_a (left most section)
  7. " * airline_b (section just to the right of airline_a)
  8. " * airline_c (section just to the right of airline_b)
  9. " * airline_x (first section of the right most sections)
  10. " * airline_y (section just to the right of airline_x)
  11. " * airline_z (right most section)
  12. " * The mode of the buffer, as reported by the :mode() function. Airline
  13. " converts the values reported by mode() to the following:
  14. " * normal
  15. " * insert
  16. " * replace
  17. " * visual
  18. " * inactive
  19. " * terminal
  20. " The last one is actually no real mode as returned by mode(), but used by
  21. " airline to style inactive statuslines (e.g. windows, where the cursor
  22. " currently does not reside in).
  23. " * In addition to each section and mode specified above, airline themes
  24. " can also specify overrides. Overrides can be provided for the following
  25. " scenarios:
  26. " * 'modified'
  27. " * 'paste'
  28. "
  29. " Airline themes are specified as a global viml dictionary using the above
  30. " sections, modes and overrides as keys to the dictionary. The name of the
  31. " dictionary is significant and should be specified as:
  32. " * g:airline#themes#<theme_name>#palette
  33. " where <theme_name> is substituted for the name of the theme.vim file where the
  34. " theme definition resides. Airline themes should reside somewhere on the
  35. " 'runtimepath' where it will be loaded at vim startup, for example:
  36. " * autoload/airline/themes/theme_name.vim
  37. "
  38. " For this, the dark.vim, theme, this is defined as
  39. let g:airline#themes#dark#palette = {}
  40. " Keys in the dictionary are composed of the mode, and if specified the
  41. " override. For example:
  42. " * g:airline#themes#dark#palette.normal
  43. " * the colors for a statusline while in normal mode
  44. " * g:airline#themes#dark#palette.normal_modified
  45. " * the colors for a statusline while in normal mode when the buffer has
  46. " been modified
  47. " * g:airline#themes#dark#palette.visual
  48. " * the colors for a statusline while in visual mode
  49. "
  50. " Values for each dictionary key is an array of color values that should be
  51. " familiar for colorscheme designers:
  52. " * [guifg, guibg, ctermfg, ctermbg, opts]
  53. " See "help attr-list" for valid values for the "opt" value.
  54. "
  55. " Each theme must provide an array of such values for each airline section of
  56. " the statusline (airline_a through airline_z). A convenience function,
  57. " airline#themes#generate_color_map() exists to mirror airline_a/b/c to
  58. " airline_x/y/z, respectively.
  59. " The dark.vim theme:
  60. let s:airline_a_normal = [ '#00005f' , '#dfff00' , 17 , 190 ]
  61. let s:airline_b_normal = [ '#ffffff' , '#444444' , 255 , 238 ]
  62. let s:airline_c_normal = [ '#9cffd3' , '#202020' , 85 , 234 ]
  63. let g:airline#themes#dark#palette.normal = airline#themes#generate_color_map(s:airline_a_normal, s:airline_b_normal, s:airline_c_normal)
  64. " It should be noted the above is equivalent to:
  65. " let g:airline#themes#dark#palette.normal = airline#themes#generate_color_map(
  66. " \ [ '#00005f' , '#dfff00' , 17 , 190 ], " section airline_a
  67. " \ [ '#ffffff' , '#444444' , 255 , 238 ], " section airline_b
  68. " \ [ '#9cffd3' , '#202020' , 85 , 234 ] " section airline_c
  69. " \)
  70. "
  71. " In turn, that is equivalent to:
  72. " let g:airline#themes#dark#palette.normal = {
  73. " \ 'airline_a': [ '#00005f' , '#dfff00' , 17 , 190 ], "section airline_a
  74. " \ 'airline_b': [ '#ffffff' , '#444444' , 255 , 238 ], "section airline_b
  75. " \ 'airline_c': [ '#9cffd3' , '#202020' , 85 , 234 ], "section airline_c
  76. " \ 'airline_x': [ '#9cffd3' , '#202020' , 85 , 234 ], "section airline_x
  77. " \ 'airline_y': [ '#ffffff' , '#444444' , 255 , 238 ], "section airline_y
  78. " \ 'airline_z': [ '#00005f' , '#dfff00' , 17 , 190 ] "section airline_z
  79. " \}
  80. "
  81. " airline#themes#generate_color_map() also uses the values provided as
  82. " parameters to create intermediary groups such as:
  83. " airline_a_to_airline_b
  84. " airline_b_to_airline_c
  85. " etc...
  86. " Here we define overrides for when the buffer is modified. This will be
  87. " applied after g:airline#themes#dark#palette.normal, hence why only certain keys are
  88. " declared.
  89. let g:airline#themes#dark#palette.normal_modified = {
  90. \ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
  91. \ }
  92. let s:airline_a_insert = [ '#00005f' , '#00dfff' , 17 , 45 ]
  93. let s:airline_b_insert = [ '#ffffff' , '#005fff' , 255 , 27 ]
  94. let s:airline_c_insert = [ '#ffffff' , '#000080' , 15 , 17 ]
  95. let g:airline#themes#dark#palette.insert = airline#themes#generate_color_map(s:airline_a_insert, s:airline_b_insert, s:airline_c_insert)
  96. let g:airline#themes#dark#palette.insert_modified = {
  97. \ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
  98. \ }
  99. let g:airline#themes#dark#palette.insert_paste = {
  100. \ 'airline_a': [ s:airline_a_insert[0] , '#d78700' , s:airline_a_insert[2] , 172 , '' ] ,
  101. \ }
  102. let g:airline#themes#dark#palette.terminal = airline#themes#generate_color_map(s:airline_a_insert, s:airline_b_insert, s:airline_c_insert)
  103. let g:airline#themes#dark#palette.replace = copy(g:airline#themes#dark#palette.insert)
  104. let g:airline#themes#dark#palette.replace.airline_a = [ s:airline_b_insert[0] , '#af0000' , s:airline_b_insert[2] , 124 , '' ]
  105. let g:airline#themes#dark#palette.replace_modified = g:airline#themes#dark#palette.insert_modified
  106. let s:airline_a_visual = [ '#000000' , '#ffaf00' , 232 , 214 ]
  107. let s:airline_b_visual = [ '#000000' , '#ff5f00' , 232 , 202 ]
  108. let s:airline_c_visual = [ '#ffffff' , '#5f0000' , 15 , 52 ]
  109. let g:airline#themes#dark#palette.visual = airline#themes#generate_color_map(s:airline_a_visual, s:airline_b_visual, s:airline_c_visual)
  110. let g:airline#themes#dark#palette.visual_modified = {
  111. \ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
  112. \ }
  113. let s:airline_a_inactive = [ '#4e4e4e' , '#1c1c1c' , 239 , 234 , '' ]
  114. let s:airline_b_inactive = [ '#4e4e4e' , '#262626' , 239 , 235 , '' ]
  115. let s:airline_c_inactive = [ '#4e4e4e' , '#303030' , 239 , 236 , '' ]
  116. let g:airline#themes#dark#palette.inactive = airline#themes#generate_color_map(s:airline_a_inactive, s:airline_b_inactive, s:airline_c_inactive)
  117. let g:airline#themes#dark#palette.inactive_modified = {
  118. \ 'airline_c': [ '#875faf' , '' , 97 , '' , '' ] ,
  119. \ }
  120. " For commandline mode, we use the colors from normal mode, except the mode
  121. " indicator should be colored differently, e.g. light green
  122. let s:airline_a_commandline = [ '#00005f' , '#00d700' , 17 , 40 ]
  123. let s:airline_b_commandline = [ '#ffffff' , '#444444' , 255 , 238 ]
  124. let s:airline_c_commandline = [ '#9cffd3' , '#202020' , 85 , 234 ]
  125. let g:airline#themes#dark#palette.commandline = airline#themes#generate_color_map(s:airline_a_commandline, s:airline_b_commandline, s:airline_c_commandline)
  126. " Accents are used to give parts within a section a slightly different look or
  127. " color. Here we are defining a "red" accent, which is used by the 'readonly'
  128. " part by default. Only the foreground colors are specified, so the background
  129. " colors are automatically extracted from the underlying section colors. What
  130. " this means is that regardless of which section the part is defined in, it
  131. " will be red instead of the section's foreground color. You can also have
  132. " multiple parts with accents within a section.
  133. let g:airline#themes#dark#palette.accents = {
  134. \ 'red': [ '#ff0000' , '' , 160 , '' ]
  135. \ }
  136. " Here we define the color map for ctrlp. We check for the g:loaded_ctrlp
  137. " variable so that related functionality is loaded if the user is using
  138. " ctrlp. Note that this is optional, and if you do not define ctrlp colors
  139. " they will be chosen automatically from the existing palette.
  140. if get(g:, 'loaded_ctrlp', 0)
  141. let g:airline#themes#dark#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
  142. \ [ '#d7d7ff' , '#5f00af' , 189 , 55 , '' ],
  143. \ [ '#ffffff' , '#875fd7' , 231 , 98 , '' ],
  144. \ [ '#5f00af' , '#ffffff' , 55 , 231 , 'bold' ])
  145. endif