forked from bfredl/bfredl.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcolors.lua
More file actions
131 lines (116 loc) · 3.05 KB
/
colors.lua
File metadata and controls
131 lines (116 loc) · 3.05 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
local h = {}
-- def_hi {{{
-- borrowed from norcallis lua pile
function h.def_hi(group, o)
local parts = {group}
if o.default then table.insert(parts, "default") end
if o.link then
if not o.default then
vim.cmd('highlight clear '..table.concat(parts, ' '))
end
table.insert(parts, 1, "link")
table.insert(parts, o.link)
return vim.cmd('highlight '..table.concat(parts, ' '))
end
if o.fg then table.insert(parts, "guifg="..o.fg) end
if o.bg then table.insert(parts, "guibg="..o.bg) end
if o.ctermfg then table.insert(parts, "ctermfg="..o.ctermfg) end
if o.ctermbg then table.insert(parts, "ctermbg="..o.ctermbg) end
if o.attr then
table.insert(parts, "gui="..o.attr)
table.insert(parts, "cterm="..o.attr)
end
if o.sp then table.insert(parts, "guisp="..o.sp) end
if o.blend then table.insert(parts, "blend="..o.blend) end
-- nvim.api.nvim_sett_highlig()(name, parts)
vim.cmd('highlight '..table.concat(parts, ' '))
end
-- }}}
h.cdef = {
darkblue = "#1a3c54";
midblue = "#232081";
ultragray = "#909090";
cyanish = "#0088ff";
cyan = "#4188ee";
violet = "#8800ff";
whitey = "#d0d0d0";
whiteish = "#dddddd";
shiny = "#eeeeee";
vic0 = "#000000";
vic1 = "#ffffff";
vic2 = "#a8734a";
vic3 = "#e9b287";
vic4 = "#772d26";
vic5 = "#b66862";
vic6 = "#85d4dc";
vic7 = "#c5ffff";
vic8 = "#a85fb4";
vic9 = "#e99df5";
vica = "#559e4a";
vicb = "#92df87";
vicc = "#42348b";
vicd = "#7e70ca";
vice = "#bdcc71";
vicf = "#ffffb0";
vic6a = "#104057";
vic6b = "#25909c";
vicca= "#2c1b63";
vicda = "#5e50ba";
}
local c = h.cdef
local basebg, endbg, tonebg
if os.getenv'NVIM_DEV' then
basebg, endbg = c.vic6a, c.vic6b
tonebg = c.vicda
else
basebg, endbg = c.vicca, c.vicc
tonebg = c.vicda
end
h.basetheme = {
-- TODO: luahl hook to interatively preview these already
Normal = {bg=basebg, fg=c.whiteish};
NormalFloat = {bg=c.midblue};
Pmenu = {bg=c.violet};
LineNr = {fg=c.vicf, bg=tonebg};
MsgArea = {bg=endbg, blend=11};
Folded = {bg=c.ultragray, fg="#222222", attr="bold"};
NonText = {fg=c.vic5};
String = {fg=c.whitey, bg=endbg};
Whitespace = {bg=c.vic6};
EndOfBuffer = {fg=endbg, bg=endbg};
Special = {fg=c.vicb};
semshiBuiltin = {link="Identifier"};
SignColumn = {bg=c.vicd};
Grupp = {bg=c.whiteish, fg="#222222"};
--Grupp = {bg='#222222', fg='#40cccc', attr="reverse"};
Option = {bg=basebg, fg="#60ff60", attr="bold"};
}
function h.setall(theme) -- {{{
for k,v in pairs(h.basetheme) do
h.def_hi(k,v)
end
end -- }}}
function h.defaults()
h.setall(h.basetheme)
end
function h.fastmode() -- {{{
local b = _G.bfredl
local bb = b.a.get_current_buf()
function _G._ccheck()
local f = b.buf.get_lines(bb, 0, -1, true)
local text = table.concat(f, "\n")
local codes = loadstring(text, b.buf.get_name(bb))
if codes then
codes().defaults()
end
end
b.exec [[
augroup fastmode
au InsertLeave,TextChanged <buffer> lua _G._ccheck()
augroup END
]]
end -- }}}
if false then
require'bfredl.colors'.fastmode()
end
return h