Skip to content

Commit f393b06

Browse files
committed
feat(theme): add neovim support
1 parent 0853646 commit f393b06

10 files changed

Lines changed: 505 additions & 6 deletions

File tree

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
The official editor themes for Rewrite.
66

7-
From landing page snippets to everyday coding, keep the Rewrite palette close in Zed and Visual Studio Code with matching dark and light modes.
7+
From landing page snippets to everyday coding, keep the Rewrite palette close in Zed, Visual Studio Code, and Neovim with matching dark and light modes.
88

9-
[Zed README](./zed/README.md)[Visual Studio Code README](./vscode/README.md)[Website](https://rewritetoday.com)[Dashboard](https://dash.rewritetoday.com)
9+
[Zed README](./zed/README.md)[Visual Studio Code README](./vscode/README.md)[Neovim README](./nvim/README.md)[Website](https://rewritetoday.com)[Dashboard](https://dash.rewritetoday.com)
1010

1111
</div>
1212

@@ -20,6 +20,7 @@ Each package owns its own installation flow, usage notes, and editor-specific de
2020

2121
- [Zed](./zed/README.md)
2222
- [Visual Studio Code](./vscode/README.md)
23+
- [Neovim](./nvim/README.md)
2324

2425
<div align="center">
2526

@@ -34,7 +35,7 @@ Each package owns its own installation flow, usage notes, and editor-specific de
3435

3536
## Contribute
3637

37-
Want to refine token colors, improve contrast, or keep both editor packages visually aligned? This repository is split by target on purpose: `zed/` owns the Zed extension package, `vscode/` owns the Visual Studio Code extension package, and `scripts/` holds the shared release helpers.
38+
Want to refine token colors, improve contrast, or keep every editor package visually aligned? This repository is split by target on purpose: `zed/` owns the Zed extension package, `vscode/` owns the Visual Studio Code extension package, `nvim/` owns the Neovim documentation, and the Neovim runtime lives at the repository root in `colors/` and `lua/` so plugin managers can install it directly from GitHub.
3839

3940
</div>
4041

@@ -51,9 +52,10 @@ When you contribute, keep the workflow simple and consistent:
5152

5253
1. Update the source theme file in `zed/themes/rewrite.json`.
5354
2. Update the matching source file in `vscode/themes/`.
54-
3. Test both variants locally: `Rewrite Night` and `Rewrite Day`.
55-
4. Rebuild the VS Code package with `cd vscode && bun install && bun run package`.
56-
5. Use the scripts in `scripts/` when you want to validate or publish release flows.
55+
3. Update the Neovim runtime in `colors/` and `lua/`.
56+
4. Test both variants locally: `Rewrite Night` and `Rewrite Day`.
57+
5. Rebuild the VS Code package with `cd vscode && bun install && bun run package`.
58+
6. Use the scripts in `scripts/` when you want to validate or publish release flows.
5759

5860
<div align="center">
5961

colors/rewrite-day.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require("rewrite").load("day", "rewrite-day")

colors/rewrite-night.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require("rewrite").load("night", "rewrite-night")

colors/rewrite.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require("rewrite").load(nil, "rewrite")

lua/lualine/themes/rewrite.lua

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
local variant = vim.o.background == "light" and "day" or "night"
2+
local palette = require("rewrite." .. variant)
3+
4+
return {
5+
normal = {
6+
a = { bg = palette.accent_strong, fg = palette.bg, gui = "bold" },
7+
b = { bg = palette.surface_alt, fg = palette.accent },
8+
c = { bg = palette.bg, fg = palette.fg },
9+
},
10+
insert = {
11+
a = { bg = palette.accent, fg = palette.bg, gui = "bold" },
12+
b = { bg = palette.surface_alt, fg = palette.accent_strong },
13+
c = { bg = palette.bg, fg = palette.fg },
14+
},
15+
visual = {
16+
a = { bg = palette.type_ref, fg = palette.bg, gui = "bold" },
17+
b = { bg = palette.surface_alt, fg = palette.type_ref },
18+
c = { bg = palette.bg, fg = palette.fg },
19+
},
20+
replace = {
21+
a = { bg = palette.error, fg = palette.bg, gui = "bold" },
22+
b = { bg = palette.surface_alt, fg = palette.error },
23+
c = { bg = palette.bg, fg = palette.fg },
24+
},
25+
command = {
26+
a = { bg = palette.comment, fg = palette.bg, gui = "bold" },
27+
b = { bg = palette.surface_alt, fg = palette.comment },
28+
c = { bg = palette.bg, fg = palette.fg },
29+
},
30+
inactive = {
31+
a = { bg = palette.bg, fg = palette.comment, gui = "bold" },
32+
b = { bg = palette.bg, fg = palette.comment },
33+
c = { bg = palette.bg, fg = palette.comment },
34+
},
35+
}

lua/rewrite/base.lua

Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
local M = {}
2+
3+
function M.highlights(palette)
4+
local highlights = {
5+
Normal = { fg = palette.fg, bg = palette.bg },
6+
NormalNC = { fg = palette.fg, bg = palette.bg },
7+
NormalFloat = { fg = palette.fg, bg = palette.surface_alt },
8+
FloatBorder = { fg = palette.border, bg = palette.surface_alt },
9+
FloatTitle = { fg = palette.accent, bg = palette.surface_alt, bold = true },
10+
ColorColumn = { bg = palette.surface },
11+
Conceal = { fg = palette.comment },
12+
Cursor = { fg = palette.bg, bg = palette.cursor },
13+
lCursor = { fg = palette.bg, bg = palette.cursor },
14+
CursorLine = { bg = palette.line },
15+
CursorColumn = { bg = palette.surface },
16+
CursorLineNr = { fg = palette.type_ref, bold = true },
17+
LineNr = { fg = palette.punct },
18+
SignColumn = { fg = palette.punct, bg = palette.bg },
19+
FoldColumn = { fg = palette.comment, bg = palette.bg },
20+
Folded = { fg = palette.comment, bg = palette.surface },
21+
Visual = { bg = palette.selection },
22+
VisualNOS = { bg = palette.selection },
23+
Search = { fg = palette.search_fg, bg = palette.search_bg },
24+
CurSearch = { fg = palette.cur_search_fg, bg = palette.cur_search_bg, bold = true },
25+
Substitute = { fg = palette.cur_search_fg, bg = palette.cur_search_bg, bold = true },
26+
MatchParen = { fg = palette.accent, bg = palette.selection, bold = true },
27+
Directory = { fg = palette.accent },
28+
Title = { fg = palette.fg, bold = true },
29+
ErrorMsg = { fg = palette.error, bg = palette.bg, bold = true },
30+
WarningMsg = { fg = palette.warning, bg = palette.bg, bold = true },
31+
MoreMsg = { fg = palette.accent },
32+
ModeMsg = { fg = palette.accent },
33+
Question = { fg = palette.accent },
34+
NonText = { fg = palette.border },
35+
Whitespace = { fg = palette.border },
36+
SpecialKey = { fg = palette.comment },
37+
EndOfBuffer = { fg = palette.bg },
38+
WinSeparator = { fg = palette.border, bg = palette.bg },
39+
StatusLine = { fg = palette.fg, bg = palette.surface_alt },
40+
StatusLineNC = { fg = palette.comment, bg = palette.bg },
41+
TabLine = { fg = palette.comment, bg = palette.surface },
42+
TabLineFill = { fg = palette.comment, bg = palette.bg },
43+
TabLineSel = { fg = palette.fg, bg = palette.surface_alt },
44+
Pmenu = { fg = palette.fg, bg = palette.surface_alt },
45+
PmenuSel = { fg = palette.fg, bg = palette.surface },
46+
PmenuSbar = { bg = palette.surface },
47+
PmenuThumb = { bg = palette.border },
48+
WildMenu = { fg = palette.bg, bg = palette.accent },
49+
QuickFixLine = { bg = palette.surface },
50+
Comment = { fg = palette.comment },
51+
Todo = { fg = palette.bg, bg = palette.accent, bold = true },
52+
Keyword = { fg = palette.keyword },
53+
Operator = { fg = palette.punct },
54+
Delimiter = { fg = palette.punct },
55+
Special = { fg = palette.accent },
56+
Identifier = { fg = palette.fg },
57+
Function = { fg = palette.fg },
58+
String = { fg = palette.accent },
59+
Number = { fg = palette.accent },
60+
Boolean = { fg = palette.accent },
61+
Constant = { fg = palette.fg },
62+
Type = { fg = palette.type_ref },
63+
Typedef = { fg = palette.fg },
64+
Label = { fg = palette.fg },
65+
Tag = { fg = palette.fg },
66+
Underlined = { fg = palette.accent, underline = true },
67+
Error = { fg = palette.error },
68+
DiffAdd = { bg = palette.diff_add_bg },
69+
DiffChange = { bg = palette.diff_change_bg },
70+
DiffDelete = { bg = palette.diff_delete_bg },
71+
DiffText = { fg = palette.accent, bg = palette.diff_change_bg, bold = true },
72+
GitSignsAdd = { fg = palette.git_add, bg = palette.bg },
73+
GitSignsChange = { fg = palette.git_change, bg = palette.bg },
74+
GitSignsDelete = { fg = palette.git_delete, bg = palette.bg },
75+
DiagnosticError = { fg = palette.error },
76+
DiagnosticWarn = { fg = palette.warning },
77+
DiagnosticInfo = { fg = palette.info },
78+
DiagnosticHint = { fg = palette.comment },
79+
DiagnosticOk = { fg = palette.success },
80+
DiagnosticVirtualTextError = { fg = palette.error, bg = palette.diff_delete_bg },
81+
DiagnosticVirtualTextWarn = { fg = palette.warning, bg = palette.diff_change_bg },
82+
DiagnosticVirtualTextInfo = { fg = palette.info, bg = palette.surface },
83+
DiagnosticVirtualTextHint = { fg = palette.comment, bg = palette.surface },
84+
DiagnosticUnderlineError = { undercurl = true, sp = palette.error },
85+
DiagnosticUnderlineWarn = { undercurl = true, sp = palette.warning },
86+
DiagnosticUnderlineInfo = { undercurl = true, sp = palette.info },
87+
DiagnosticUnderlineHint = { undercurl = true, sp = palette.comment },
88+
TelescopeNormal = { fg = palette.fg, bg = palette.surface_alt },
89+
TelescopeBorder = { fg = palette.border, bg = palette.surface_alt },
90+
TelescopePromptNormal = { fg = palette.fg, bg = palette.surface_alt },
91+
TelescopePromptBorder = { fg = palette.border, bg = palette.surface_alt },
92+
TelescopePromptTitle = { fg = palette.bg, bg = palette.accent_strong, bold = true },
93+
TelescopePreviewTitle = { fg = palette.bg, bg = palette.comment, bold = true },
94+
TelescopeResultsTitle = { fg = palette.bg, bg = palette.type_ref, bold = true },
95+
TelescopeSelection = { bg = palette.surface },
96+
TelescopeMatching = { fg = palette.accent, bold = true },
97+
}
98+
99+
local links = {
100+
IncSearch = "CurSearch",
101+
SpecialComment = "Comment",
102+
Character = "String",
103+
Float = "Number",
104+
Conditional = "Keyword",
105+
Repeat = "Keyword",
106+
Statement = "Keyword",
107+
PreProc = "Keyword",
108+
Include = "Keyword",
109+
Define = "Keyword",
110+
Macro = "Keyword",
111+
StorageClass = "Keyword",
112+
Structure = "Keyword",
113+
Exception = "Keyword",
114+
VertSplit = "WinSeparator",
115+
["@annotation"] = "Comment",
116+
["@comment"] = "Comment",
117+
["@comment.documentation"] = "Comment",
118+
["@comment.error"] = "DiagnosticError",
119+
["@comment.warning"] = "DiagnosticWarn",
120+
["@comment.todo"] = "Todo",
121+
["@comment.note"] = "DiagnosticInfo",
122+
["@keyword"] = "Keyword",
123+
["@keyword.conditional"] = "Keyword",
124+
["@keyword.repeat"] = "Keyword",
125+
["@keyword.return"] = "Keyword",
126+
["@keyword.operator"] = "Keyword",
127+
["@keyword.exception"] = "Keyword",
128+
["@keyword.import"] = "Keyword",
129+
["@keyword.directive"] = "Keyword",
130+
["@keyword.function"] = "Keyword",
131+
["@operator"] = "Operator",
132+
["@punctuation"] = "Delimiter",
133+
["@punctuation.bracket"] = "Delimiter",
134+
["@punctuation.delimiter"] = "Delimiter",
135+
["@string"] = "String",
136+
["@string.documentation"] = "String",
137+
["@string.escape"] = "String",
138+
["@string.regex"] = "String",
139+
["@string.special"] = "String",
140+
["@character"] = "String",
141+
["@character.special"] = "String",
142+
["@number"] = "Number",
143+
["@number.float"] = "Float",
144+
["@boolean"] = "Boolean",
145+
["@constant"] = "Constant",
146+
["@constant.builtin"] = "Type",
147+
["@constant.macro"] = "Constant",
148+
["@module"] = "Identifier",
149+
["@namespace"] = "Identifier",
150+
["@symbol"] = "Constant",
151+
["@variable"] = "Identifier",
152+
["@variable.builtin"] = "Identifier",
153+
["@variable.parameter"] = "Identifier",
154+
["@variable.parameter.builtin"] = "Identifier",
155+
["@variable.member"] = "Identifier",
156+
["@property"] = "Identifier",
157+
["@field"] = "Identifier",
158+
["@constructor"] = "Identifier",
159+
["@function"] = "Function",
160+
["@function.builtin"] = "Function",
161+
["@function.call"] = "Function",
162+
["@function.macro"] = "Function",
163+
["@method"] = "Function",
164+
["@method.call"] = "Function",
165+
["@function.method"] = "Function",
166+
["@type"] = "Type",
167+
["@type.builtin"] = "Type",
168+
["@type.definition"] = "Identifier",
169+
["@attribute"] = "Identifier",
170+
["@tag"] = "Tag",
171+
["@tag.attribute"] = "Identifier",
172+
["@tag.delimiter"] = "Delimiter",
173+
["@markup.heading"] = "Title",
174+
["@markup.heading.1"] = "Title",
175+
["@markup.heading.2"] = "Title",
176+
["@markup.heading.3"] = "Title",
177+
["@markup.heading.4"] = "Title",
178+
["@markup.heading.5"] = "Title",
179+
["@markup.heading.6"] = "Title",
180+
["@markup.list"] = "Keyword",
181+
["@markup.link"] = "Identifier",
182+
["@markup.link.label"] = "Identifier",
183+
["@markup.link.url"] = "Underlined",
184+
["@markup.raw"] = "String",
185+
["@markup.quote"] = "Comment",
186+
["@markup.math"] = "String",
187+
["@markup.strikethrough"] = "Comment",
188+
["@diff.plus"] = "DiffAdd",
189+
["@diff.minus"] = "DiffDelete",
190+
["@diff.delta"] = "DiffChange",
191+
["@lsp.type.class"] = "Type",
192+
["@lsp.type.interface"] = "Type",
193+
["@lsp.type.type"] = "Type",
194+
["@lsp.type.struct"] = "Type",
195+
["@lsp.type.enum"] = "Type",
196+
["@lsp.type.typeParameter"] = "Identifier",
197+
["@lsp.type.parameter"] = "Identifier",
198+
["@lsp.type.property"] = "Identifier",
199+
["@lsp.type.variable"] = "Identifier",
200+
["@lsp.type.namespace"] = "Identifier",
201+
["@lsp.type.function"] = "Function",
202+
["@lsp.type.method"] = "Function",
203+
["@lsp.type.enumMember"] = "Constant",
204+
["@lsp.type.keyword"] = "Keyword",
205+
["@lsp.typemod.class.declaration"] = "Identifier",
206+
["@lsp.typemod.interface.declaration"] = "Identifier",
207+
["@lsp.typemod.type.declaration"] = "Identifier",
208+
["@lsp.typemod.enum.declaration"] = "Identifier",
209+
["@lsp.typemod.type.defaultLibrary"] = "Type",
210+
["@lsp.typemod.variable.defaultLibrary"] = "Type",
211+
["@lsp.typemod.variable.readonly"] = "Constant",
212+
["@lsp.typemod.property.readonly"] = "Constant",
213+
htmlTag = "Tag",
214+
htmlEndTag = "Tag",
215+
htmlTagName = "Tag",
216+
htmlArg = "Identifier",
217+
htmlString = "String",
218+
}
219+
220+
for group, link in pairs(links) do
221+
highlights[group] = { link = link }
222+
end
223+
224+
highlights["@markup.italic"] = { fg = palette.fg, italic = true }
225+
highlights["@markup.emphasis"] = { fg = palette.fg, italic = true }
226+
highlights["@markup.strong"] = { fg = palette.fg, bold = true }
227+
highlights["markdownItalic"] = { fg = palette.fg, italic = true }
228+
highlights["markdownBold"] = { fg = palette.fg, bold = true }
229+
230+
return highlights
231+
end
232+
233+
return M

lua/rewrite/day.lua

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
return {
2+
bg = "#f5eee3",
3+
surface = "#faf3e8",
4+
surface_alt = "#ece2d4",
5+
panel = "#f0e7da",
6+
line = "#ece2d4",
7+
border = "#dacdbd",
8+
selection = "#eadac5",
9+
fg = "#3b3027",
10+
fg_soft = "#4a3d33",
11+
comment = "#8c7b69",
12+
keyword = "#8c7b69",
13+
type_ref = "#8f7e6d",
14+
punct = "#b5a694",
15+
accent = "#c96a2d",
16+
accent_strong = "#a85121",
17+
cursor = "#a85121",
18+
error = "#b24430",
19+
warning = "#c96a2d",
20+
info = "#2563eb",
21+
success = "#15803d",
22+
git_add = "#15803d",
23+
git_change = "#c96a2d",
24+
git_delete = "#b24430",
25+
diff_add_bg = "#e7f3ea",
26+
diff_change_bg = "#f7eadf",
27+
diff_delete_bg = "#f7e4de",
28+
search_bg = "#fed7aa",
29+
search_fg = "#3b3027",
30+
cur_search_bg = "#c96a2d",
31+
cur_search_fg = "#fffaf4",
32+
}

0 commit comments

Comments
 (0)