nvim/colors/plain2.lua (view raw)
1vim.cmd('hi clear')
2
3if vim.fn.exists('syntax on') == 1 then
4 vim.cmd('syntax reset')
5end
6
7vim.g.colors_name = 'plain2'
8
9local colors = {
10 black = { gui = "#222222", cterm = "0" },
11 medium_gray = { gui = "#767676", cterm = "8" },
12 white = { gui = "#F1F1F1", cterm = "7" },
13 actual_white = { gui = "#FFFFFF", cterm = "15" },
14 light_black = { gui = "#424242", cterm = "11" },
15 lighter_black = { gui = "#545454", cterm = "12" },
16 subtle_black = { gui = "#303030", cterm = "11" },
17 light_gray = { gui = "#999999", cterm = "12" },
18 lighter_gray = { gui = "#CCCCCC", cterm = "7" },
19 lightest_gray = { gui = "#E5E5E5", cterm = "13" },
20 pink = { gui = "#FB007A", cterm = "5" },
21 dark_red = { gui = "#C30771", cterm = "1" },
22 light_red = { gui = "#E32791", cterm = "1" },
23 orange = { gui = "#D75F5F", cterm = "9" },
24 darker_blue = { gui = "#005F87", cterm = "4" },
25 dark_blue = { gui = "#008EC4", cterm = "4" },
26 blue = { gui = "#20BBFC", cterm = "4" },
27 light_blue = { gui = "#B6D6FD", cterm = "4" },
28 dark_cyan = { gui = "#20A5BA", cterm = "6" },
29 light_cyan = { gui = "#4FB8CC", cterm = "6" },
30 dark_green = { gui = "#10A778", cterm = "6" },
31 light_green = { gui = "#5FD7A7", cterm = "6" },
32 dark_purple = { gui = "#523C79", cterm = "5" },
33 light_purple = { gui = "#6855DE", cterm = "5" },
34 light_yellow = { gui = "#F3E430", cterm = "3" },
35 dark_yellow = { gui = "#A89C14", cterm = "3" },
36}
37
38local bg, bg_subtle, bg_very_subtle, norm, norm_subtle, purple, cyan, green, red, yellow, visual, cursor_line, status_line, status_line_nc, constant, comment, selection, warning
39
40if vim.o.background == "dark" then
41 bg = colors.white
42 bg_subtle = colors.lighter_gray
43 bg_very_subtle = colors.light_gray
44 norm = colors.light_black
45 norm_subtle = colors.lighter_black
46 purple = colors.dark_purple
47 cyan = colors.dark_cyan
48 green = colors.dark_green
49 red = colors.dark_red
50 yellow = colors.dark_yellow
51 visual = colors.light_blue
52 cursor_line = colors.medium_gray
53 status_line = colors.lighter_gray
54 status_line_nc = colors.lighter_black
55 constant = colors.dark_blue
56 comment = colors.light_gray
57 selection = colors.light_yellow
58 warning = colors.yellow
59else
60 bg = colors.black
61 bg_subtle = colors.light_black
62 bg_very_subtle = colors.subtle_black
63 norm = colors.lighter_gray
64 norm_subtle = colors.light_gray
65 purple = colors.light_purple
66 cyan = colors.light_cyan
67 green = colors.light_green
68 red = colors.light_red
69 yellow = colors.light_yellow
70 visual = colors.subtle_black
71 cursor_line = colors.subtle_black
72 status_line = colors.lighter_black
73 status_line_nc = colors.subtle_black
74 constant = colors.light_green
75 comment = colors.lighter_black
76 selection = colors.light_purple
77 warning = colors.yellow
78end
79
80local highlights = {
81 firstAccent = { fg = cyan },
82 secondAccent = { fg = purple },
83 Normal = { fg = norm },
84 Noise = { fg = norm_subtle },
85 Cursor = { bg = green, fg = norm },
86 Comment = { fg = comment, cterm = "italic" },
87 Function = { fg = norm, cterm = "bold" },
88 FloatWin = { fg = norm, bg = colors.black },
89 Constant = { link = "firstAccent" },
90 Character = { link = "Constant" },
91 Number = { link = "Constant" },
92 Boolean = { link = "Constant" },
93 Float = { link = "Constant" },
94 String = { link = "Constant" },
95 Identifier = { link = "Normal" },
96 Statement = { link = "Normal" },
97 Conditonal = { link = "Statement" },
98 Repeat = { link = "Statement" },
99 Label = { link = "Statement" },
100 Operator = { link = "Noise" },
101 Keyword = { link = "Statement" },
102 Exception = { link = "Statement" },
103 PreProc = { link = "Normal" },
104 Include = { link = "Statement" },
105 Define = { link = "PreProc" },
106 Macro = { link = "PreProc" },
107 PreCondit = { link = "PreProc" },
108 Type = { link = "secondAccent" },
109 StorageClass = { link = "Type" },
110 Structure = { link = "Noise" },
111 Typedef = { link = "Noise" },
112 Special = { link = "StatusLine" },
113 SpecialChar = { link = "Special" },
114 Tag = { link = "Special" },
115 Delimiter = { link = "Special" },
116 SpecialComment = { link = "Special" },
117 Debug = { link = "Special" },
118 Conceal = { link = "NonText" },
119 Underlined = { fg = norm, gui = "underline", cterm = "underline" },
120 Ignore = { fg = bg },
121 Error = { fg = red, cterm = "bold" },
122 Todo = { fg = colors.actual_white, bg = colors.black, gui = "bold", cterm = "bold" },
123 SpecialKey = { fg = colors.subtle_black },
124 NonText = { fg = bg_very_subtle },
125 Directory = { fg = green },
126 ErrorMsg = { fg = colors.pink },
127 IncSearch = { bg = selection, fg = colors.black },
128 Search = { bg = selection, fg = colors.black },
129 MoreMsg = { fg = colors.medium_gray, cterm = "bold", gui = "bold" },
130 ModeMsg = { link = "MoreMsg" },
131 LineNr = { fg = colors.medium_gray },
132 CursorLineNr = { fg = green, bg = bg_very_subtle },
133 Question = { fg = red },
134 VertSplit = { bg = bg, fg = bg_very_subtle },
135 Title = { fg = green },
136 Visual = { bg = visual },
137 VisualNOS = { bg = bg_subtle },
138 WarningMsg = { fg = warning },
139 WildMenu = { fg = colors.white, bg = bg },
140 Folded = { fg = colors.medium_gray },
141 FoldColumn = { fg = bg_subtle },
142 DiffAdd = { fg = green },
143 DiffDelete = { fg = red },
144 DiffChange = { fg = yellow },
145 DiffText = { fg = green },
146 SignColumn = { fg = colors.medium_gray },
147 SpellBad = { gui = "underline", sp = red },
148 SpellCap = { gui = "underline", sp = light_green },
149 SpellRare = { gui = "underline", sp = colors.pink },
150 SpellLocal = { gui = "underline", sp = green },
151 StatusLine = { fg = status_line },
152 StatusLineNC = { fg = status_line_nc },
153 StatusLineOk = { gui = "underline", bg = bg, fg = green },
154 StatusLineError = { gui = "underline", bg = bg, fg = colors.pink },
155 StatusLineWarning = { gui = "underline", bg = bg, fg = warning },
156 Pmenu = { fg = norm, bg = bg_subtle },
157 PmenuSel = { fg = green, bg = bg_very_subtle, gui = "bold" },
158 PmenuSbar = { fg = norm, bg = bg_subtle },
159 PmenuThumb = { fg = norm, bg = bg_subtle },
160 TabLine = { fg = norm_subtle, bg = bg },
161 TabLineSel = { fg = norm, bg = bg, gui = "bold", cterm = "bold" },
162 TabLineFill = { fg = norm_subtle, bg = bg },
163 CursorColumn = { bg = bg_very_subtle },
164 CursorLine = { bg = cursor_line },
165 ColorColumn = { bg = bg_subtle },
166 MatchParen = { bg = bg_very_subtle, fg = norm, cterm = "bold" },
167 qfLineNr = { link = "secondAccent" },
168 qfFileName = { link = "firstAccent" },
169 htmlH1 = { fg = norm },
170 htmlH2 = { fg = norm },
171 htmlH3 = { fg = norm },
172 htmlH4 = { fg = norm },
173 htmlH5 = { fg = norm },
174 htmlH6 = { fg = norm },
175 htmlBold = { fg = norm },
176 htmlItalic = { fg = norm },
177 htmlEndTag = { fg = norm },
178 htmlTag = { fg = norm },
179 htmlTagName = { fg = norm },
180 htmlArg = { fg = norm },
181 htmlError = { fg = red },
182 javaScript = { bg = bg, fg = norm },
183 javaScriptBraces = { bg = bg, fg = norm },
184 javaScriptNumber = { bg = bg, fg = green },
185 diffRemoved = { link = "DiffDelete" },
186 diffAdded = { link = "DiffAdd" },
187 TSAnnotation = { link = "secondAccent" },
188 TSAttribute = { link = "secondAccent" },
189 TSBoolean = { link = "Constant" },
190 TSCharacter = { link = "Constant" },
191 TSComment = { link = "Comment" },
192 TSConstructor = { link = "Normal" },
193 TSConditional = { link = "Statement" },
194 TSConstant = { link = "Constant" },
195 TSConstBuiltin = { link = "secondAccent" },
196 TSConstMacro = { link = "secondAccent" },
197 TSError = { link = "Error" },
198 TSException = { link = "Error" },
199 TSField = { link = "Normal" },
200 TSFloat = { link = "Constant" },
201 TSFunction = { link = "Normal" },
202 TSFuncBuiltin = { link = "secondAccent" },
203 TSFuncMacro = { link = "secondAccent" },
204 TSInclude = { link = "Noise" },
205 TSKeyword = { link = "Statement" },
206 TSKeywordFunction = { link = "Statement" },
207 TSLabel = { link = "Noise" },
208 TSMethod = { link = "Normal" },
209 TSNamespace = { link = "Noise" },
210 TSNone = { link = "Noise" },
211 TSNumber = { link = "Constant" },
212 TSOperator = { link = "Normal" },
213 TSParameter = { link = "Noise" },
214 TSParameterReference = { link = "Statement" },
215 TSProperty = { link = "TSField" },
216 TSPunctDelimiter = { link = "Noise" },
217 TSPunctBracket = { link = "Noise" },
218 TSPunctSpecial = { link = "Noise" },
219 TSRepeat = { link = "Normal" },
220 TSString = { link = "Constant" },
221 TSStringRegex = { link = "secondAccent" },
222 TSStringEscape = { link = "secondAccent" },
223 TSTag = { link = "Statement" },
224 TSTagDelimiter = { link = "Noise" },
225 TSText = { link = "Normal" },
226 TSEmphasis = { link = "Comment" },
227 TSUnderline = { link = "Underlined" },
228 TSStrike = { link = "Underlined" },
229 TSTitle = { link = "Statement" },
230 TSLiteral = { link = "Noise" },
231 TSURI = { link = "Constant" },
232 TSType = { link = "Noise" },
233 TSTypeBuiltin = { link = "secondAccent" },
234 TSVariable = { link = "Normal" },
235 TSVariableBuiltin = { link = "Normal" },
236 TSRepeat = { link = "Statement" },
237 LspDiagnosticsDefaultError = { link = "Error" },
238 LspDiagnosticsDefaultWarning = { link = "WarningMsg" },
239 LspDiagnosticsDefaultInformation = { link = "Noise" },
240 LspDiagnosticsDefaultHint = { link = "Constant" },
241 SignifySignAdd = { link = "LineNr" },
242 SignifySignDelete = { link = "LineNr" },
243 SignifySignChange = { link = "LineNr" },
244 GitGutterAdd = { link = "LineNr" },
245 GitGutterDelete = { link = "LineNr" },
246 GitGutterChange = { link = "LineNr" },
247 GitGutterChangeDelete = { link = "LineNr" },
248 jsFlowTypeKeyword = { link = "Statement" },
249 jsFlowImportType = { link = "Statement" },
250 jsFunction = { link = "Function" },
251 jsGlobalObjects = { link = "Noise" },
252 jsGlobalNodeObjects = { link = "Normal" },
253 jsSwitchCase = { link = "Constant" },
254 jsSpreadOperator = { bg = bg, fg = selection },
255 jsReturn = { link = "jsSpreadOperator" },
256 jsExport = { link = "jsSpreadOperator" },
257 rustModPath = { fg = colors.lightest_gray },
258 rustMacro = { link = "secondAccent" },
259 rustKeyword = { link = "Noise" },
260 rustDerive = { link = "secondAccent" },
261 rustDeriveTrait = { link = "secondAccent" },
262 rustAttribute = { link = "secondAccent" },
263 rustLifetime = { link = "secondAccent" },
264 schemeSyntax = { link = "Normal" },
265 schemeParentheses = { link = "Noise" },
266 schemeIdentifier = { link = "Noise" },
267 lispParen = { link = "Noise" },
268 lispSymbol = { link = "Noise" },
269 shCommandSub = { link = "secondAccent" },
270 cFormat = { link = "secondAccent" },
271 nixBuiltin = { link = "secondAccent" },
272 nixNamespacedBuiltin = { link = "secondAccent" },
273 sqlSpecial = { link = "firstAccent" },
274 sqlKeyword = { link = "secondAccent" },
275 helpExample = { link = "Noise" },
276 helpCommand = { link = "secondAccent" },
277 helpBacktick = { link = "secondAccent" },
278 helpSpecial = { link = "Noise" },
279 StorageClass = { link = "Statement" },
280 elmType = { link = "Type" },
281 xmlTag = { link = "Constant" },
282 xmlTagName = { link = "xmlTag" },
283 xmlEndTag = { link = "xmlTag" },
284 xmlAttrib = { link = "xmlTag" },
285 markdownH1 = { link = "Statement" },
286 markdownH2 = { link = "Statement" },
287 markdownH3 = { link = "Statement" },
288 markdownH4 = { link = "Statement" },
289 markdownH5 = { link = "Statement" },
290 markdownH6 = { link = "Statement" },
291 markdownListMarker = { link = "Constant" },
292 markdownCode = { link = "Constant" },
293 markdownCodeBlock = { link = "Constant" },
294 markdownCodeDelimiter = { link = "Constant" },
295 markdownHeadingDelimiter = { link = "Constant" },
296 cssBraces = { bg = bg, fg = selection },
297 cssTextProp = { link = "Noise" },
298 cssTagName = { link = "Normal" },
299 NormalFloat = { link = "FloatWin" },
300 CmpItemKind = { link = "firstAccent" },
301 CmpItemAbbrMatch = { link = "secondAccent" },
302}
303
304if vim.fn.has("gui_running") == 0 then
305 highlights.SpellBad = { cterm = "underline", fg = red }
306 highlights.SpellCap = { cterm = "underline", fg = light_green }
307 highlights.SpellRare = { cterm = "underline", fg = colors.pink }
308 highlights.SpellLocal = { cterm = "underline", fg = green }
309end
310
311for group, opts in pairs(highlights) do
312 if opts.link then
313 vim.api.nvim_set_hl(0, group, { link = opts.link })
314 else
315 vim.api.nvim_set_hl(0, group, opts)
316 end
317end