-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathneovim.lua
More file actions
92 lines (89 loc) · 2.08 KB
/
neovim.lua
File metadata and controls
92 lines (89 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
-- Read colors from the single source of truth: colors.toml
-- This prevents drift between terminals and Neovim
local function read_colors()
local path = vim.fn.expand("~/.config/omarchy/current/theme/colors.toml")
local file = io.open(path, "r")
if not file then
return nil
end
local ok, colors = pcall(function()
local c = {}
for line in file:lines() do
local key, value = line:match('^(%w+)%s*=%s*"(#%x+)"')
if key and value then
c[key] = value
end
end
return c
end)
file:close()
if not ok then
return nil
end
return colors
end
local c = read_colors()
-- Fallback: if colors.toml is missing or unreadable, use Kanso defaults
if not c then
vim.notify("Crystal: colors.toml not found, using Kanso defaults", vim.log.levels.WARN)
return {
{ "webhooked/kanso.nvim", lazy = false, priority = 1000, opts = { background = { dark = "zen" } } },
{ "LazyVim/LazyVim", opts = { colorscheme = "kanso-zen" } },
}
end
return {
{
"webhooked/kanso.nvim",
lazy = false,
priority = 1000,
opts = {
background = { dark = "zen" },
foreground = "saturated",
colors = {
palette = {
-- Map colors.toml → Kanso palette
-- Foreground / background
fg = c.foreground,
fg2 = c.foreground,
zenBg0 = c.background,
zenBg1 = c.color0,
zenBg2 = c.selection_background,
-- ANSI reds
red3 = c.color1,
red2 = c.color9,
-- ANSI greens
green3 = c.color2,
green2 = c.color10,
green5 = c.color14,
-- ANSI yellows
yellow3 = c.color3,
yellow2 = c.color11,
-- ANSI blues
blue3 = c.color4,
blue = c.color12,
blue2 = c.blue2,
-- Violet / pink
pink = c.color5,
violet = c.color13,
violet2 = c.violet2,
-- Cyan / aqua
aqua = c.color6,
-- Orange (constants, string escapes)
orange = c.orange,
orange2 = c.orange2,
-- Grays (operators, punctuation, comments, nontext)
gray2 = c.color8,
gray3 = c.gray3,
gray4 = c.gray4,
gray5 = c.gray5,
},
},
},
},
{
"LazyVim/LazyVim",
opts = {
colorscheme = "kanso-zen",
},
},
}