tokyonight.vim 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. " =============================================================================
  2. " URL: https://github.com/ghifarit53/tokyonight-vim/
  3. " Filename: autoload/lightline/colorscheme/tokyonight.vim
  4. " Author: Ghifari Taqiuddin
  5. " Email: mghifarit53@gmail.com
  6. " License: MIT License
  7. " =============================================================================
  8. "{{{Palette
  9. let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
  10. let s:style = get(g:, 'tokyonight_style', 'night')
  11. if s:style ==# 'night'
  12. let s:foreground = [ '#a9b1d6', 250 ]
  13. let s:background = [ '#1a1b26', 235 ]
  14. let s:background_alt = [ '#232433', 236 ]
  15. let s:background_grey = [ '#444B6A', 238 ]
  16. let s:red = [ '#F7768E', 203 ]
  17. let s:yellow = [ '#E0AF68', 179 ]
  18. let s:green = [ '#9ECE6A', 107 ]
  19. let s:blue = [ '#7AA2F7', 110 ]
  20. let s:purple = [ '#ad8ee6', 176 ]
  21. elseif s:style ==# 'storm'
  22. let s:foreground = [ '#a9b1d6', 250 ]
  23. let s:background = [ '#24283b', 235 ]
  24. let s:background_alt = [ '#2c3047', 236 ]
  25. let s:background_grey = [ '#444B6A', 238 ]
  26. let s:red = [ '#F7768E', 203 ]
  27. let s:yellow = [ '#E0AF68', 179 ]
  28. let s:green = [ '#9ECE6A', 107 ]
  29. let s:blue = [ '#7AA2F7', 110 ]
  30. let s:purple = [ '#ad8ee6', 176 ]
  31. endif
  32. "}}}
  33. "{{{Definition
  34. let s:tab_l_fg = s:foreground
  35. let s:tab_l_bg = s:background_grey
  36. let s:tab_r_fg = s:red
  37. let s:tab_r_bg = s:background_grey
  38. let s:tab_sel_fg = s:background
  39. let s:tab_sel_bg = s:red
  40. let s:tab_middle_fg = s:foreground
  41. let s:tab_middle_bg = s:background_alt
  42. let s:warningfg = s:background
  43. let s:warningbg = s:yellow
  44. let s:errorfg = s:background
  45. let s:errorbg = s:red
  46. let s:normal_l1_fg = s:background
  47. let s:normal_l1_bg = s:blue
  48. let s:normal_l2_fg = s:foreground
  49. let s:normal_l2_bg = s:background_grey
  50. let s:normal_r1_fg = s:background
  51. let s:normal_r1_bg = s:blue
  52. let s:normal_r2_fg = s:foreground
  53. let s:normal_r2_bg = s:background_grey
  54. let s:normal_middle_fg = s:foreground
  55. let s:normal_middle_bg = s:background_alt
  56. let s:insert_l1_fg = s:background
  57. let s:insert_l1_bg = s:green
  58. let s:insert_l2_fg = s:foreground
  59. let s:insert_l2_bg = s:background_grey
  60. let s:insert_r1_fg = s:background
  61. let s:insert_r1_bg = s:green
  62. let s:insert_r2_fg = s:foreground
  63. let s:insert_r2_bg = s:background_grey
  64. let s:insert_middle_fg = s:foreground
  65. let s:insert_middle_bg = s:background_alt
  66. let s:visual_l1_fg = s:background
  67. let s:visual_l1_bg = s:purple
  68. let s:visual_l2_fg = s:foreground
  69. let s:visual_l2_bg = s:background_grey
  70. let s:visual_r1_fg = s:background
  71. let s:visual_r1_bg = s:purple
  72. let s:visual_r2_fg = s:foreground
  73. let s:visual_r2_bg = s:background_grey
  74. let s:visual_middle_fg = s:foreground
  75. let s:visual_middle_bg = s:background_alt
  76. let s:replace_l1_fg = s:background
  77. let s:replace_l1_bg = s:yellow
  78. let s:replace_l2_fg = s:foreground
  79. let s:replace_l2_bg = s:background_grey
  80. let s:replace_r1_fg = s:background
  81. let s:replace_r1_bg = s:yellow
  82. let s:replace_r2_fg = s:foreground
  83. let s:replace_r2_bg = s:background_grey
  84. let s:replace_middle_fg = s:foreground
  85. let s:replace_middle_bg = s:background_alt
  86. let s:inactive_l1_fg = s:foreground
  87. let s:inactive_l1_bg = s:background_grey
  88. let s:inactive_l2_fg = s:foreground
  89. let s:inactive_l2_bg = s:background_grey
  90. let s:inactive_r1_fg = s:foreground
  91. let s:inactive_r1_bg = s:background_grey
  92. let s:inactive_r2_fg = s:foreground
  93. let s:inactive_r2_bg = s:background_grey
  94. let s:inactive_middle_fg = s:foreground
  95. let s:inactive_middle_bg = s:background_alt
  96. "}}}
  97. "{{{Implementation
  98. let s:p.normal.middle = [ [ s:normal_middle_fg, s:normal_middle_bg ] ]
  99. let s:p.normal.left = [ [ s:normal_l1_fg, s:normal_l1_bg ], [ s:normal_l2_fg, s:normal_l2_bg ] ]
  100. let s:p.normal.right = [ [ s:normal_r1_fg, s:normal_r1_bg ], [ s:normal_r2_fg, s:normal_r2_bg ] ]
  101. let s:p.insert.middle = [ [ s:insert_middle_fg, s:insert_middle_bg ] ]
  102. let s:p.insert.left = [ [ s:insert_l1_fg, s:insert_l1_bg ], [ s:insert_l2_fg, s:insert_l2_bg ] ]
  103. let s:p.insert.right = [ [ s:insert_r1_fg, s:insert_r1_bg ], [ s:insert_r2_fg, s:insert_r2_bg ] ]
  104. let s:p.visual.middle = [ [ s:visual_middle_fg, s:visual_middle_bg ] ]
  105. let s:p.visual.left = [ [ s:visual_l1_fg, s:visual_l1_bg ], [ s:visual_l2_fg, s:visual_l2_bg ] ]
  106. let s:p.visual.right = [ [ s:visual_r1_fg, s:visual_r1_bg ], [ s:visual_r2_fg, s:visual_r2_bg ] ]
  107. let s:p.replace.middle = [ [ s:replace_middle_fg, s:replace_middle_bg ] ]
  108. let s:p.replace.left = [ [ s:replace_l1_fg, s:replace_l1_bg ], [ s:replace_l2_fg, s:replace_l2_bg ] ]
  109. let s:p.replace.right = [ [ s:replace_r1_fg, s:replace_r1_bg ], [ s:replace_r2_fg, s:replace_r2_bg ] ]
  110. let s:p.inactive.left = [ [ s:inactive_l1_fg, s:inactive_l1_bg ], [ s:inactive_l2_fg, s:inactive_l2_bg ] ]
  111. let s:p.inactive.middle = [ [ s:inactive_middle_fg, s:inactive_middle_bg ] ]
  112. let s:p.inactive.right = [ [ s:inactive_r1_fg, s:inactive_r1_bg ], [ s:inactive_r2_fg, s:inactive_r2_bg ] ]
  113. let s:p.tabline.left = [ [ s:tab_l_fg, s:tab_l_bg] ]
  114. let s:p.tabline.right = [ [ s:tab_r_fg, s:tab_r_bg] ]
  115. let s:p.tabline.tabsel = [ [ s:tab_sel_fg, s:tab_sel_bg ] ]
  116. let s:p.tabline.middle = [ [ s:tab_middle_fg, s:tab_middle_bg] ]
  117. let s:p.normal.error = [ [ s:errorfg, s:errorbg ] ]
  118. let s:p.normal.warning = [ [ s:warningfg, s:warningbg ] ]
  119. "}}}
  120. let g:lightline#colorscheme#tokyonight#palette = lightline#colorscheme#flatten(s:p)