Skip to content

Commit 62bd408

Browse files
committed
✨ port basic spaceduck to lua
1 parent b00ea26 commit 62bd408

2 files changed

Lines changed: 315 additions & 0 deletions

File tree

colors/spaceduck.lua

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

lua/spaceduck.lua

Lines changed: 314 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,314 @@
1+
-- ===============================================================
2+
-- spaceduck
3+
--
4+
-- URL: https://github.com/pineapplegiant/spaceduck
5+
-- Author: Guillermo Rodriguez
6+
-- License: MIT
7+
-- ===============================================================
8+
vim.opt.background = "dark"
9+
vim.api.nvim_command("hi clear")
10+
11+
local syntaxOnExists = vim.api.nvim_exec("exists('syntax_on')", true)
12+
if syntaxOnExists == 1 then
13+
vim.api.nvim_command("syntax reset")
14+
end
15+
16+
vim.g.colors_name = "spaceduck"
17+
18+
local Italic = ""
19+
if vim.g.spaceduck_italic then
20+
Italic = "italic"
21+
end
22+
23+
local Bold = ""
24+
if vim.g.spaceduck_bold then
25+
Bold = "bold"
26+
end
27+
28+
local colors = {
29+
cream = { hex = "#ecf0c1", cterm = 255 },
30+
white = { hex = "#FFFFFF", cterm = 15 },
31+
32+
black = { hex = "#000000", cterm = 0 },
33+
blackish = { hex = "#0f111b", cterm = 233 },
34+
35+
dark_blue = { hex = "#16172d", cterm = 234 },
36+
37+
dark_grey = { hex = "#1b1c36", cterm = 234 },
38+
greyer = { hex = "#c1c3cc", cterm = 251 },
39+
grey = { hex = "#818596", cterm = 102 },
40+
41+
dark_purple = { hex = "#30365F", cterm = 237 },
42+
grey_purple = { hex = "#686f9a", cterm = 60 },
43+
purple = { hex = "#7a5ccc", cterm = 98 },
44+
light_purple = { hex = "#b3a1e6", cterm = 146 },
45+
46+
cyan = { hex = "#00a3cc", cterm = 38 },
47+
green = { hex = "#5ccc96", cterm = 78 },
48+
orange = { hex = "#e39400", cterm = 172 },
49+
red = { hex = "#e33400", cterm = 166 },
50+
yellow = { hex = "#f2ce00", cterm = 220 },
51+
magenta = { hex = "#ce6f8f", cterm = 168 },
52+
}
53+
54+
vim.g.terminal_color_foreground = colors.cream.hex
55+
vim.g.terminal_color_background = colors.blackish.hex
56+
vim.g.terminal_color_0 = colors.black.hex
57+
vim.g.terminal_color_1 = colors.red.hex
58+
vim.g.terminal_color_2 = colors.green.hex
59+
vim.g.terminal_color_3 = colors.light_purple.hex
60+
vim.g.terminal_color_4 = colors.cyan.hex
61+
vim.g.terminal_color_5 = colors.magenta.hex
62+
vim.g.terminal_color_6 = colors.purple.hex
63+
vim.g.terminal_color_7 = colors.grey_purple.hex
64+
vim.g.terminal_color_8 = colors.grey_purple.hex
65+
vim.g.terminal_color_9 = colors.red.hex
66+
vim.g.terminal_color_10 = colors.green.hex
67+
vim.g.terminal_color_11 = colors.light_purple.hex
68+
vim.g.terminal_color_12 = colors.cyan.hex
69+
vim.g.terminal_color_13 = colors.magenta.hex
70+
vim.g.terminal_color_14 = colors.purple.hex
71+
vim.g.terminal_color_15 = colors.cream.hex
72+
73+
vim.g.terminal_ansi_colors = [colors.black.hex, colors.red.hex, colors.green.hex, colors.light_purple.hex, colors.cyan.hex, colors.magenta.hex, colors.purple.hex, colors.grey_purple, colors.grey_purple, colors.red.hex, colors.green.hex, colors.light_purple.hex, colors.cyan.hex, colors.magenta.hex, colors.purple.hex, colors.cream.hex]
74+
75+
local scheme = {
76+
ColorColumn = { bg = colors.dark_blue.hex, ctermbg = colors.dark_blue.cterm },
77+
CursorColumn = { bg = colors.dark_blue.hex, ctermbg = colors.dark_blue.cterm },
78+
Conceal = { fg = colors.grey_purple.hex, ctermfg = colors.grey_purple.cterm },
79+
Cursor = { fg = colors.blackish.hex, ctermfg = colors.blackish.cterm, bg = colors.grey.hex, ctermbg = colors.grey.cterm },
80+
CursorIM = { link = "Cursor" },
81+
CursorLine = { bg = colors.dark_blue.hex, ctermfg = colors.dark_blue.cterm },
82+
CursorLineNr = { fg = colors.greyer.hex, ctermfg = colors.greyer.cterm, bg = colors.dark_blue.hex, ctermbg = colors.dark_blue.cterm },
83+
Directory = { fg = colors.cyan.hex, ctermfg = colors.cyan.cterm },
84+
DiffAdd = { fg = colors.green.hex, ctermfg = colors.green.cterm, bg = colors.dark_grey.hex, ctermbg = colors.dark_grey.cterm },
85+
DiffChange = { fg = colors.orange.hex, ctermfg = colors.orange.cterm, bg = colors.dark_grey.hex, ctermbg = colors.dark_grey.cterm },
86+
DiffDelete = { fg = colors.red.hex, ctermfg = colors.red.cterm, bg = colors.dark_grey.hex, ctermbg = colors.dark_grey.cterm },
87+
DiffText = { fg = colors.yellow.hex, ctermfg = colors.yellow.cterm, bg = colors.dark_grey.hex, ctermbg = colors.dark_grey.cterm },
88+
EndOfBuffer = { fg = colors.dark_purple.hex, ctermfg = colors.dark_purple.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm },
89+
TermCursor = { link = "Cursor" },
90+
ErrorMsg = { fg = colors.red.hex, ctermfg = colors.red.cterm },
91+
VertSplit = { fg = colors.black.hex, ctermfg = colors.black.cterm, bg = colors.black.hex, ctermbg = colors.black.cterm },
92+
Folded = { fg = colors.grey_purple.hex, ctermfg = colors.grey_purple.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm },
93+
FoldColumn = { fg = colors.dark_purple.hex, ctermfg = colors.dark_purple.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm },
94+
SignColumn = { fg = colors.dark_purple.hex, ctermfg = colors.dark_purple.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm },
95+
IncSearch = { fg = colors.white.hex, ctermfg = colors.white.cterm, bg = colors.dark_purple.hex, ctermbg = colors.dark_purple.cterm },
96+
LineNr = { fg = colors.dark_purple.hex, ctermfg = colors.dark_purple.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm },
97+
MatchParen = { fg = colors.white.hex, ctermfg = colors.white.cterm, bg = colors.dark_purple.hex, ctermbg = colors.dark_purple.cterm },
98+
ModeMsg = { fg = colors.light_purple.hex, ctermfg = colors.light_purple.cterm },
99+
MoreMsg = { fg = colors.light_purple.hex, ctermfg = colors.light_purple.cterm },
100+
NonText = { link = "EndOfBuffer" },
101+
Pmenu = { fg = colors.cream.hex, ctermfg = colors.cream.cterm, bg = colors.dark_grey.hex, ctermbg = colors.dark_grey.cterm },
102+
PmenuSel = { fg = colors.white.hex, ctermfg = colors.white.cterm, bg = colors.dark_purple.hex, ctermbg = colors.dark_purple.cterm },
103+
PmenuSbar = { bg = colors.dark_purple.hex, ctermbg = colors.dark_purple.cterm },
104+
PmenuThumb = { bg = colors.grey_purple.hex, ctermbg = colors.grey_purple.cterm },
105+
Question = { fg = colors.light_purple.hex, ctermfg = colors.light_purple.cterm },
106+
QuickFixLine = { fg = colors.cream.hex, ctermfg = colors.cream.cterm, bg = colors.dark_blue.hex, ctermbg = colors.dark_blue.cterm },
107+
Search = { fg = colors.white.hex, ctermfg = colors.white.cterm, bg = colors.grey_purple.hex, ctermbg = colors.grey_purple.cterm },
108+
SpecialKey = { fg = colors.orange.hex, ctermfg = colors.orange.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm },
109+
SpellBad = { fg = colors.red.hex, ctermfg = colors.red.cterm, underline = true },
110+
SpellLocal = { fg = colors.cream.hex, ctermfg = colors.cream.cterm, underline = true },
111+
SpellCap = { fg = colors.green.hex, ctermfg = colors.green.cterm, underline = true },
112+
SpellRare = { fg = colors.yellow.hex, ctermfg = colors.yellow.cterm, underline = true },
113+
StatusLine = { fg = colors.cream.hex, ctermfg = colors.cream.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm, reverse = true },
114+
StatusLineTerm = { link = "StatusLine" },
115+
StatusLineTermNC = { fg = colors.black.hex, ctermfg = colors.black.cterm, bg = colors.dark_purple.hex, ctermbg = colors.dark_purple.cterm, reverse = true },
116+
StatusLineNC = { link = "StatusLineTermNC " },
117+
TabLine = { fg = colors.black.hex, ctermfg = colors.black.cterm, bg = colors.grey.hex, ctermbg = colors.grey.cterm },
118+
TabLineFill = { fg = colors.grey.hex, ctermfg = colors.grey.cterm, bg = colors.black.hex, ctermbg = colors.black.cterm },
119+
TabLineSel = { fg = colors.greyer.hex, ctermfg = colors.greyer.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm },
120+
Visual = { bg = colors.dark_grey.hex, ctermbg = colors.dark_grey.cterm },
121+
VisualNOS = { link = "Visual" },
122+
WarningMsg = { fg = colors.orange.hex, ctermfg = colors.orange.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm },
123+
WildMenu = { fg = colors.black.hex, ctermfg = colors.black.cterm, bg = colors.greyer.hex, ctermbg = colors.greyer.cterm },
124+
Whitespace = { link = "EndOfBuffer" },
125+
diffAdded = { fg = colors.light_purple.hex, ctermfg = colors.light_purple.cterm },
126+
diffRemoved = { fg = colors.red.hex, ctermfg = colors.red.cterm },
127+
Normal = { fg = colors.cream.hex, ctermfg = colors.cream.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm },
128+
Comment = { fg = colors.dark_purple.hex, ctermfg = colors.dark_purple.cterm },
129+
Constant = { fg = colors.yellow.hex, ctermfg = colors.yellow.cterm },
130+
Identifier = { fg = colors.cyan.hex, ctermfg = colors.cyan.cterm },
131+
Statement = { fg = colors.green.hex, ctermfg = colors.green.cterm },
132+
PreProc = { fg = colors.light_purple.hex, ctermfg = colors.light_purple.cterm },
133+
Type = { fg = colors.magenta.hex, ctermfg = colors.magenta.cterm },
134+
Special = { fg = colors.light_purple.hex, ctermfg = colors.light_purple.cterm },
135+
Underlined = { fg = colors.green.hex, ctermfg = colors.green.cterm, underline = true },
136+
Error = { fg = colors.red.hex, ctermfg = colors.red.cterm },
137+
Ignore = { fg = colors.red.hex, ctermfg = colors.red.cterm },
138+
Delimiter = { fg = colors.cream.hex, ctermfg = colors.cream.cterm },
139+
Operator = { fg = colors.magenta.hex, ctermfg = colors.magenta.cterm },
140+
Tag = { fg = colors.light_purple.hex, ctermfg = colors.light_purple.cterm },
141+
Debug = { fg = colors.light_purple.hex, ctermfg = colors.light_purple.cterm },
142+
StorageClass = { fg = colors.light_purple.hex, ctermfg = colors.light_purple.cterm },
143+
String = { fg = colors.cyan.hex, ctermfg = colors.cyan.cterm },
144+
Structure = { fg = colors.cyan.hex, ctermfg = colors.cyan.cterm },
145+
Typedef = { fg = colors.cyan.hex, ctermfg = colors.cyan.cterm },
146+
Function = { fg = colors.green.hex, ctermfg = colors.green.cterm },
147+
Include = { fg = colors.green.hex, ctermfg = colors.green.cterm },
148+
Label = { fg = colors.green.hex, ctermfg = colors.green.cterm },
149+
Exception = { fg = colors.orange.hex, ctermfg = colors.orange.cterm },
150+
Keyword = { fg = colors.orange.hex, ctermfg = colors.orange.cterm },
151+
SpecialChar = { fg = colors.orange.hex, ctermfg = colors.orange.cterm },
152+
Boolean = { fg = colors.yellow.hex, ctermfg = colors.yellow.cterm },
153+
Character = { fg = colors.yellow.hex, ctermfg = colors.yellow.cterm },
154+
Float = { fg = colors.yellow.hex, ctermfg = colors.yellow.cterm },
155+
Number = { fg = colors.yellow.hex, ctermfg = colors.yellow.cterm },
156+
Conditional = { fg = colors.green.hex, ctermfg = colors.green.cterm },
157+
Repeat = { fg = colors.green.hex, ctermfg = colors.green.cterm },
158+
Title = { fg = colors.purple.hex, ctermfg = colors.purple.cterm },
159+
Define = { fg = colors.purple.hex, ctermfg = colors.purple.cterm },
160+
Macro = { fg = colors.purple.hex, ctermfg = colors.purple.cterm },
161+
PreCondit = { fg = colors.purple.hex, ctermfg = colors.purple.cterm },
162+
SpecialComment = { link = "Comment" },
163+
Todo = { fg = colors.white.hex, ctermfg = colors.white.cterm, bg = colors.grey_purple.hex, ctermbg = colors.grey_purple.cterm, underline = true },
164+
165+
cFormat = { link = "Title" },
166+
cCppOutIf1 = { link = "Normal" },
167+
cCppOutIf2 = { link = "Normal" },
168+
cBracket = { link = "Title" },
169+
170+
cssBraces = { link = "Normal" },
171+
cssSelectorOp = { fg = colors.magenta.hex, ctermfg = colors.magenta.cterm },
172+
173+
fortranType = { link = "Tag" },
174+
fortranStructure = { link = "Structure" },
175+
fortranStorageClass = { link = "StorageClass" },
176+
fortranUnitHeader = { link = "Title" },
177+
178+
haskellType = { link = "Tag" },
179+
haskellIdentifier = { link = "Label" },
180+
haskellKeyword = { link = "Boolean" },
181+
haskellDecl = { link = "Boolean" },
182+
183+
htmlTagName = { link = "Function" },
184+
htmlEndTag = { link = "Conditional" },
185+
htmlArg = { link = "Tag" },
186+
htmlSpecialTagName = { link = "Type" },
187+
188+
javaClassDecl = { link = "Structure" },
189+
javaTypeDef = { link = "Keyword" },
190+
191+
jsStorageClass = { link = "Title" },
192+
jsFunction = { link = "Function" },
193+
jsFuncName = { link = "Special" },
194+
jsOperator = { link = "Operator" },
195+
jsNull = { link = "Constant" },
196+
jsGlobalObjects = { link = "Constant" },
197+
jsFuncCall = { link = "Function" },
198+
jsOperatorKeyword = { link = "Operator" },
199+
jsExceptions = { link = "Error" },
200+
jsTernaryIfOperator = { link = "Title" },
201+
jsTemplateBraces = { link = "Title" },
202+
jsTemplateExpression = { link = "String" },
203+
204+
texTypeStyle = { link = "Special" },
205+
206+
mkdDelimiter = { link = "Normal" },
207+
208+
phpFunction = { link = "Function" },
209+
phpMethod = { link = "Function" },
210+
phpType = { link = "Constant" },
211+
phpIdentifier = { link = "Type" },
212+
phpStringSingle = { link = "String" },
213+
phpStringDouble = { link = "String" },
214+
215+
pythonOperator = { fg = colors.magenta.hex, ctermfg = colors.magenta.cterm },
216+
217+
rubyConstant = { link = "Constant" },
218+
rubyDefine = { link = "Define" },
219+
rubyMethodName = { link = "Function" },
220+
rubyInstanceVariable = { link = "Tag" },
221+
rubyKeywordAsMethod = { link = "Tag" },
222+
223+
jsxTagName = { link = "HTMLTagName" },
224+
jsxComponentName = { link = "Tag" },
225+
jsxOpenPunct = { link = "jsxTagName" },
226+
jsxClosePunct = { link = "jsxOpenPunct" },
227+
jsxCloseString = { link = "jsxClosePunct" },
228+
229+
typescriptProp = { link = "Tag" },
230+
typescriptVariable = { link = "Title" },
231+
typescriptArrowFunc = { fg = colors.magenta.hex, ctermfg = colors.magenta.cterm },
232+
typescriptBraces = { link = "Normal" },
233+
typescriptNumberStaticMethod = { link = "Function" },
234+
typescriptNumberMethod = { link = "Function" },
235+
typescriptStringStaticMethod = { link = "Function" },
236+
typescriptStringMethod = { link = "Function" },
237+
typescriptArrayStaticMethod = { link = "Function" },
238+
typescriptArrayMethod = { link = "Function" },
239+
typescriptObjectStaticMethod = { link = "Function" },
240+
typescriptObjectMethod = { link = "Function" },
241+
typescriptSymbolStaticMethod = { link = "Function" },
242+
typescriptFunctionMethod = { link = "Function" },
243+
typescriptMathStaticMethod = { link = "Function" },
244+
typescriptDateStaticMethod = { link = "Function" },
245+
typescriptDateMethod = { link = "Function" },
246+
typescriptJSONStaticMethod = { link = "Function" },
247+
typescriptRegExpMethod = { link = "Function" },
248+
typescriptES6MapMethod = { link = "Function" },
249+
typescriptES6SetMethod = { link = "Function" },
250+
typescriptPromiseStaticMethod = { link = "Function" },
251+
typescriptPromiseMethod = { link = "Function" },
252+
typescriptReflectMethod = { link = "Function" },
253+
typescriptIntlMethod = { link = "Function" },
254+
typescriptBOMNavigatorMethod = { link = "Function" },
255+
typescriptServiceWorkerMethod = { link = "Function" },
256+
typescriptBOMLocationMethod = { link = "Function" },
257+
typescriptBOMHistoryMethod = { link = "Function" },
258+
typescriptConsoleMethod = { link = "Function" },
259+
typescriptXHRMethod = { link = "Function" },
260+
typescriptFileMethod = { link = "Function" },
261+
typescriptFileReaderMethod = { link = "Function" },
262+
typescriptFileListMethod = { link = "Function" },
263+
typescriptBlobMethod = { link = "Function" },
264+
typescriptURLStaticMethod = { link = "Function" },
265+
typescriptSubtleCryptoMethod = { link = "Function" },
266+
typescriptCryptoMethod = { link = "Function" },
267+
typescriptHeadersMethod = { link = "Function" },
268+
typescriptRequestMethod = { link = "Function" },
269+
typescriptResponseMethod = { link = "Function" },
270+
typescriptCacheMethod = { link = "Function" },
271+
typescriptEncodingMethod = { link = "Function" },
272+
typescriptGeolocationMethod = { link = "Function" },
273+
typescriptPaymentMethod = { link = "Function" },
274+
typescriptPaymentResponseMethod = { link = "Function" },
275+
typescriptDOMNodeMethod = { link = "Function" },
276+
typescriptDOMDocMethod = { link = "Function" },
277+
typescriptDOMEventTargetMethod = { link = "Function" },
278+
typescriptDOMEventMethod = { link = "Function" },
279+
typescriptDOMStorageMethod = { link = "Function" },
280+
typescriptDOMFormMethod = { link = "Function" },
281+
282+
vimGroupName = { link = "Normal" },
283+
284+
yamlKeyValueDelimiter = { link = "Normal" },
285+
yamlBlockMappingKey = { link = "Function" },
286+
287+
vistaTag = { link = "Conditional" },
288+
vistaIcon = { link = "Identifier" },
289+
vistaColon = { link = "Normal" },
290+
vistaScope = { link = "Constant" },
291+
vistaKind = { link = "Conditional" },
292+
293+
Sneak = { fg = colors.black.hex, ctermfg = colors.black.cterm, bg = colors.yellow.hex, ctermbg = colors.yellow.cterm },
294+
BufferCurrent = { fg = colors.greyer.hex, ctermfg = colors.greyer.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm },
295+
BufferVisible = { fg = colors.dark_purple.hex, ctermfg = colors.dark_purple.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm },
296+
BufferInactive = { fg = colors.dark_purple.hex, ctermfg = colors.dark_purple.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm },
297+
BufferTabpageFill = { fg = colors.blackish.hex, ctermfg = colors.blackish.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm },
298+
BufferCurrentIndex = { fg = colors.green.hex, ctermfg = colors.green.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm },
299+
BufferVisibleIndex = { fg = colors.dark_purple.hex, ctermfg = colors.dark_purple.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm },
300+
BufferInactiveIndex = { fg = colors.dark_purple.hex, ctermfg = colors.dark_purple.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm },
301+
BufferCurrentMod = { fg = colors.orange.hex, ctermfg = colors.orange.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm },
302+
BufferVisibleMod = { fg = colors.orange.hex, ctermfg = colors.orange.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm },
303+
BufferInactiveMod = { fg = colors.orange.hex, ctermfg = colors.orange.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm },
304+
BufferCurrentSign = { fg = colors.green.hex, ctermfg = colors.green.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm },
305+
BufferVisibleSign = { fg = colors.dark_purple.hex, ctermfg = colors.dark_purple.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm },
306+
BufferInactiveSign = { fg = colors.dark_purple.hex, ctermfg = colors.dark_purple.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm },
307+
BufferCurrentTarget = { fg = colors.magenta.hex, ctermfg = colors.magenta.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm },
308+
BufferVisibleTarget = { fg = colors.magenta.hex, ctermfg = colors.magenta.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm },
309+
BufferInactiveTarget = { fg = colors.magenta.hex, ctermfg = colors.magenta.cterm, bg = colors.blackish.hex, ctermbg = colors.blackish.cterm },
310+
}
311+
312+
for group, config in pairs(scheme) do
313+
vim.api.nvim_set_hl(0, group, config)
314+
end

0 commit comments

Comments
 (0)