logo

dotfiles

My dotfiles, one branch per machine, rebased on base git clone https://anongit.hacktivis.me/git/dotfiles.git/

gruvbox.lua (6438B)


  1. -- Copyright © 2017 morhetz <morhetz@gmail.com>
  2. -- Copyright © 2023 Haelwenn (lanodan) Monnier <contact+gruvbox.lua@hacktivis.me>
  3. -- SPDX-License-Identifier: MIT
  4. -- Port of gruvbox https://github.com/morhetz/gruvbox for vis
  5. local lexers = vis.lexers
  6. gb = {}
  7. gb.dark0_hard = '#1d2021' -- 29-32-33
  8. gb.dark0 = '#282828' -- 40-40-40
  9. gb.dark0_soft = '#32302f' -- 50-48-47
  10. gb.dark1 = '#3c3836' -- 60-56-54
  11. gb.dark2 = '#504945' -- 80-73-69
  12. gb.dark3 = '#665c54' -- 102-92-84
  13. gb.dark4 = '#7c6f64' -- 124-111-100
  14. gb.dark4_256 = '#7c6f64' -- 124-111-100
  15. gb.gray_245 = '#928374' -- 146-131-116
  16. gb.gray_244 = '#928374' -- 146-131-116
  17. gb.light0_hard = '#f9f5d7' -- 249-245-215
  18. gb.light0 = '#fbf1c7' -- 253-244-193
  19. gb.light0_soft = '#f2e5bc' -- 242-229-188
  20. gb.light1 = '#ebdbb2' -- 235-219-178
  21. gb.light2 = '#d5c4a1' -- 213-196-161
  22. gb.light3 = '#bdae93' -- 189-174-147
  23. gb.light4 = '#a89984' -- 168-153-132
  24. gb.light4_256 = '#a89984' -- 168-153-132
  25. gb.bright_red = '#fb4934' -- 251-73-52
  26. gb.bright_green = '#b8bb26' -- 184-187-38
  27. gb.bright_yellow = '#fabd2f' -- 250-189-47
  28. gb.bright_blue = '#83a598' -- 131-165-152
  29. gb.bright_purple = '#d3869b' -- 211-134-155
  30. gb.bright_aqua = '#8ec07c' -- 142-192-124
  31. gb.bright_orange = '#fe8019' -- 254-128-25
  32. gb.neutral_red = '#cc241d' -- 204-36-29
  33. gb.neutral_green = '#98971a' -- 152-151-26
  34. gb.neutral_yellow = '#d79921' -- 215-153-33
  35. gb.neutral_blue = '#458588' -- 69-133-136
  36. gb.neutral_purple = '#b16286' -- 177-98-134
  37. gb.neutral_aqua = '#689d6a' -- 104-157-106
  38. gb.neutral_orange = '#d65d0e' -- 214-93-14
  39. gb.faded_red = '#9d0006' -- 157-0-6
  40. gb.faded_green = '#79740e' -- 121-116-14
  41. gb.faded_yellow = '#b57614' -- 181-118-20
  42. gb.faded_blue = '#076678' -- 7-102-120
  43. gb.faded_purple = '#8f3f71' -- 143-63-113
  44. gb.faded_aqua = '#427b58' -- 66-123-88
  45. gb.faded_orange = '#af3a03' -- 175-58-3
  46. if is_dark == undefined then
  47. is_dark = true
  48. end
  49. if is_dark then
  50. gb.bg0 = gb.dark0
  51. if contrast_dark == 'soft' then
  52. gb.bg0 = gb.dark0_soft
  53. elseif contrast_dark == 'hard' then
  54. gb.bg0 = gb.dark0_hard
  55. end
  56. gb.bg1 = gb.dark1
  57. gb.bg2 = gb.dark2
  58. gb.bg3 = gb.dark3
  59. gb.bg4 = gb.dark4
  60. gb.gray = gb.gray_245
  61. gb.fg0 = gb.light0
  62. gb.fg1 = gb.light1
  63. gb.fg2 = gb.light2
  64. gb.fg3 = gb.light3
  65. gb.fg4 = gb.light4
  66. gb.fg4_256 = gb.light4_256
  67. gb.red = gb.bright_red
  68. gb.green = gb.bright_green
  69. gb.yellow = gb.bright_yellow
  70. gb.blue = gb.bright_blue
  71. gb.purple = gb.bright_purple
  72. gb.aqua = gb.bright_aqua
  73. gb.orange = gb.bright_orange
  74. else
  75. gb.bg0 = gb.light0
  76. if contrast_light == 'soft' then
  77. gb.bg0 = gb.light0_soft
  78. elseif contrast_light == 'hard' then
  79. gb.bg0 = gb.light0_hard
  80. end
  81. gb.bg1 = gb.light1
  82. gb.bg2 = gb.light2
  83. gb.bg3 = gb.light3
  84. gb.bg4 = gb.light4
  85. gb.gray = gb.gray_244
  86. gb.fg0 = gb.dark0
  87. gb.fg1 = gb.dark1
  88. gb.fg2 = gb.dark2
  89. gb.fg3 = gb.dark3
  90. gb.fg4 = gb.dark4
  91. gb.fg4_256 = gb.dark4_256
  92. gb.red = gb.faded_red
  93. gb.green = gb.faded_green
  94. gb.yellow = gb.faded_yellow
  95. gb.blue = gb.faded_blue
  96. gb.purple = gb.faded_purple
  97. gb.aqua = gb.faded_aqua
  98. gb.orange = gb.faded_orange
  99. end
  100. local italicize_comments = ',notitalics'
  101. if gruvbox_italicize_comments == undefined then
  102. italicize_comments = ',italics'
  103. else
  104. if gruvbox_italicize_comments then
  105. italicize_comments = ',italics'
  106. end
  107. end
  108. local italicize_strings = ',notitalics'
  109. if gruvbox_italicize_strings == undefined then
  110. italicize_strings = ',notitalics'
  111. else
  112. if gruvbox_italicize_strings then
  113. italicize_strings = ',italics'
  114. end
  115. end
  116. lexers.STYLE_NOTHING = ''
  117. -- Normal text
  118. lexers.STYLE_DEFAULT = 'fore:'..gb.fg1..',back:'..gb.bg0
  119. -- CursorLine
  120. lexers.STYLE_CURSOR_LINE = 'back:'..gb.bg1
  121. -- miss: CursorColumn
  122. -- miss: TabLineFill, TabLineSel, TabLine
  123. -- miss: MatchParen
  124. -- ColorColumn
  125. lexers.STYLE_COLOR_COLUMN = 'back:'..gb.bg1
  126. -- miss: Conceal
  127. -- miss: CursorLineNr
  128. -- miss: StatusLine
  129. -- miss: VertSplit
  130. -- Folded
  131. lexers.STYLE_FOLDDISPLAYTEXT = 'fore:'..gb.gray..',back:'..gb.bg1..',italics'
  132. -- miss: FoldColumn
  133. -- Cursor
  134. lexers.STYLE_CURSOR = 'back:'..gb.bg4
  135. lexers.STYLE_CURSOR_PRIMARY = lexers.STYLE_CURSOR .. ',fore:'..gb.yellow
  136. -- vCursor
  137. lexers.STYLE_SELECTION = 'back:'..gb.bg1
  138. -- miss: iCursor, lCursor
  139. -- miss: Special
  140. -- Comment
  141. lexers.STYLE_COMMENT = 'fore:'..gb.gray..italicize_comments
  142. -- miss: Todo
  143. -- Error
  144. lexers.STYLE_ERROR = 'back:'..gb.red,',bold' -- Note: vim gruvbox uses reverse-video
  145. -- miss: Statement, Conditional, Repeat, Label, Exception
  146. -- Operator
  147. lexers.STYLE_OPERATOR = lexers.STYLE_DEFAULT
  148. lexers.STYLE_KEYWORD = 'fore:'..gb.red
  149. -- Identifier
  150. lexers.STYLE_VARIABLE = 'fore:'..gb.blue
  151. -- Function
  152. lexers.STYLE_FUNCTION = 'fore:'..gb.green..',bold'
  153. -- PreProc
  154. lexers.STYLE_PREPROCESSOR = 'fore:'..gb.aqua
  155. -- miss: Include, Define, Macro, PreCondit
  156. -- Constant
  157. lexers.STYLE_CONSTANT = 'fore:'..gb.purple
  158. -- miss: Character
  159. -- String
  160. if gruvbox_improved_strings == 0 then
  161. lexers.STYLE_STRING = 'fore:'..gb.green..italicize_strings
  162. else
  163. lexers.STYLE_STRING = 'fore:'..gb.fg1..',back:'..gb.bg1..italicize_strings
  164. end
  165. -- miss: Boolean
  166. -- Number
  167. lexers.STYLE_NUMBER = 'fore:'..gb.purple
  168. -- miss: Float
  169. -- Type
  170. lexers.STYLE_TYPE = 'fore:'..gb.yellow
  171. -- miss: StorageClass, Structure, Typedef
  172. -- miss: "Completion Menu", "Diffs", "spell"
  173. -- miss: IndentGuidesOdd, IndentGuidesEven
  174. -- Reused: javascriptClassName
  175. lexers.STYLE_CLASS = 'fore:'..gb.yellow
  176. -- Reused: clojureRegexp
  177. lexers.STYLE_REGEX = 'fore:'..gb.aqua
  178. ----------------------
  179. -- undefined styles --
  180. ----------------------
  181. lexers.STYLE_LABEL = 'fore:'..gb.green
  182. lexers.STYLE_WHITESPACE = ''
  183. lexers.STYLE_EMBEDDED = 'back:'..gb.blue..',bold'
  184. lexers.STYLE_IDENTIFIER = 'fore:'..gb.fg0
  185. lexers.STYLE_LINENUMBER = 'back:'..gb.bg1 .. ',fore:'..gb.fg2
  186. lexers.STYLE_LINENUMBER_CURSOR = 'back:'..gb.bg1 .. ',fore:'..gb.fg1 .. ',bold'
  187. lexers.STYLE_BRACELIGHT = 'fore:'..gb.fg1
  188. lexers.STYLE_BRACEBAD = lexers.STYLE_BRACELIGHT .. lexers.STYLE_ERROR
  189. -- lexers.STYLE_CONTROLCHAR
  190. -- lexers.STYLE_INDENTGUIDE
  191. -- lexers.STYLE_CALLTIP
  192. lexers.STYLE_STATUS = lexers.STYLE_LINENUMBER
  193. lexers.STYLE_STATUS_FOCUSED = lexers.STYLE_LINENUMBER_CURSOR
  194. ---------------
  195. -- overrides --
  196. ---------------
  197. if gruvbox_comment_hard then
  198. lexers.STYLE_COMMENT = 'fore:'..gb.aqua..',italics'
  199. end