Compare commits
4 commits
6063ca4cda
...
f3ae0c07c3
Author | SHA1 | Date | |
---|---|---|---|
f3ae0c07c3 | |||
94a4d39c19 | |||
df7bbeae91 | |||
46ccd31961 |
2 changed files with 77 additions and 67 deletions
126
lua/gruvbox.lua
126
lua/gruvbox.lua
|
@ -1,62 +1,69 @@
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
|
local to_hex = function(s)
|
||||||
|
local r, g, b = string.match(s, "^rgb%(%s*(%d+),%s*(%d+),%s*(%d+)%)")
|
||||||
|
return string.format("#%02x%02x%02x", r, g, b)
|
||||||
|
end
|
||||||
|
|
||||||
M.colors = function()
|
M.colors = function()
|
||||||
local c = { -- 16 | 16 | 256 |
|
local c = {
|
||||||
-- dark | light | colors | R G B
|
dark0_h = to_hex("rgb( 19, 21, 22)"),
|
||||||
--------+-------+--------+---------------
|
dark0 = to_hex("rgb( 24, 25, 26)"),
|
||||||
dark0 = '#171a1b', -- | | 232 | 23 26 27
|
dark0_s = to_hex("rgb( 29, 32, 33)"), -- bg0_h
|
||||||
dark0_s = '#1d2021', -- | | 233 | 29 32 33
|
-- to_hex("rgb( 40, 40, 40)"), -- bg0
|
||||||
dark1 = '#3c3836', -- | 15 | 237 | 60 56 54
|
-- to_hex("rgb( 50, 48, 47)"), -- bg0_s
|
||||||
dark2 = '#504945', -- | | 239 | 80 73 69
|
dark1 = to_hex("rgb( 60, 56, 54)"),
|
||||||
dark3 = '#665c54', -- | | 241 | 102 92 84
|
dark2 = to_hex("rgb( 80, 73, 69)"),
|
||||||
dark4 = '#7c6f64', -- | 7 | 243 | 124 111 100
|
dark3 = to_hex("rgb(102, 92, 84)"),
|
||||||
gray = '#928374', -- 8 | 8 | 24[4,5]| 146 131 116
|
dark4 = to_hex("rgb(124, 111, 100)"),
|
||||||
light4 = '#a89984', -- 7 | | 246 | 168 153 132
|
gray = to_hex("rgb(146, 131, 116)"),
|
||||||
light3 = '#bdae93', -- | | 248 | 189 174 147
|
light4 = to_hex("rgb(168, 153, 132)"),
|
||||||
light2 = '#d5c4a1', -- | | 250 | 213 196 161
|
light3 = to_hex("rgb(189, 174, 147)"),
|
||||||
light1 = '#ebdbb2', -- 15 | | 223 | 235 219 178
|
light2 = to_hex("rgb(213, 196, 161)"),
|
||||||
light0_s = '#f2e5bc', -- | | 228 | 242 229 188
|
light1 = to_hex("rgb(235, 219, 178)"),
|
||||||
light0 = '#fbf1c7', -- | 0 | 229 | 253 244 193
|
light0_s = to_hex("rgb(242, 229, 188)"),
|
||||||
|
light0 = to_hex("rgb(251, 241, 199)"),
|
||||||
|
light0_h = to_hex("rgb(249, 245, 215)"),
|
||||||
|
|
||||||
red_darkest = '#2e100f',
|
red_darkest = to_hex("rgb( 46, 16, 15)"),
|
||||||
green_darkest = '#2e2e0f',
|
green_darkest = to_hex("rgb( 46, 46, 15)"),
|
||||||
yellow_darkest = '#2e240f',
|
yellow_darkest = to_hex("rgb( 46, 36, 15)"),
|
||||||
blue_darkest = '#142829',
|
blue_darkest = to_hex("rgb( 20, 40, 41)"),
|
||||||
purple_darkest = '#29141e',
|
purple_darkest = to_hex("rgb( 41, 20, 30)"),
|
||||||
aqua_darkest = '#182519',
|
aqua_darkest = to_hex("rgb( 24, 37, 25)"),
|
||||||
orange_darkest = '#321a0b',
|
orange_darkest = to_hex("rgb( 50, 26, 11)"),
|
||||||
|
|
||||||
red_darker = '#9d0006', -- | 9 | 88 | 157 0 6
|
red_darker = to_hex("rgb(157, 0, 6)"),
|
||||||
green_darker = '#79740e', -- | 10 | 100 | 121 116 14
|
green_darker = to_hex("rgb(121, 116, 14)"),
|
||||||
yellow_darker = '#b57614', -- | 11 | 136 | 181 118 20
|
yellow_darker = to_hex("rgb(181, 118, 20)"),
|
||||||
blue_darker = '#076678', -- | 12 | 24 | 6 102 120
|
blue_darker = to_hex("rgb( 7, 102, 120)"),
|
||||||
purple_darker = '#8f3f71', -- | 13 | 96 | 143 63 113
|
purple_darker = to_hex("rgb(143, 63, 113)"),
|
||||||
aqua_darker = '#427b58', -- | 14 | 66 | 66 123 88
|
aqua_darker = to_hex("rgb( 66, 123, 88)"),
|
||||||
orange_darker = '#af3a03', -- | | 130 | 175 58 3
|
orange_darker = to_hex("rgb(175, 58, 3)"),
|
||||||
|
|
||||||
red = '#cc241d', -- 1 | 1 | 123 | 204 36 29
|
red = to_hex("rgb(204, 36, 29)"),
|
||||||
green = '#98971a', -- 2 | 2 | 106 | 152 151 26
|
green = to_hex("rgb(152, 151, 26)"),
|
||||||
yellow = '#d79921', -- 3 | 3 | 172 | 215 153 33
|
yellow = to_hex("rgb(215, 153, 33)"),
|
||||||
blue = '#458588', -- 4 | 4 | 66 | 69 133 136
|
blue = to_hex("rgb( 69, 133, 136)"),
|
||||||
purple = '#b16286', -- 5 | 5 | 132 | 177 98 134
|
purple = to_hex("rgb(177, 98, 134)"),
|
||||||
aqua = '#689d6a', -- 6 | 6 | 72 | 104 157 106
|
aqua = to_hex("rgb(104, 157, 106)"),
|
||||||
orange = '#d65d0e', -- | | 166 | 214 93 14
|
orange = to_hex("rgb(214, 93, 14)"),
|
||||||
|
|
||||||
red_lighter = '#fb4934', -- 9 | | 167 | 251 73 52
|
red_lighter = to_hex("rgb(251, 73, 52)"),
|
||||||
green_lighter = '#b8bb26', -- 10 | | 142 | 184 187 38
|
green_lighter = to_hex("rgb(184, 187, 38)"),
|
||||||
yellow_lighter = '#fabd2f', -- 11 | | 214 | 250 189 47
|
yellow_lighter = to_hex("rgb(250, 189, 47)"),
|
||||||
blue_lighter = '#83a598', -- 12 | | 109 | 131 165 152
|
blue_lighter = to_hex("rgb(131, 165, 152)"),
|
||||||
purple_lighter = '#d3869b', -- 13 | | 175 | 211 134 155
|
purple_lighter = to_hex("rgb(211, 134, 155)"),
|
||||||
aqua_lighter = '#8ec07c', -- 14 | | 108 | 142 192 124
|
aqua_lighter = to_hex("rgb(142, 192, 124)"),
|
||||||
orange_lighter = '#fe8019', -- | | 208 | 254 128 25
|
orange_lighter = to_hex("rgb(254, 128, 25)"),
|
||||||
|
|
||||||
red_lightest = '#ffd7d4',
|
red_lightest = to_hex("rgb(255, 215, 212)"),
|
||||||
green_lightest = '#eeeed2',
|
green_lightest = to_hex("rgb(238, 238, 210)"),
|
||||||
yellow_lightest = '#f3eace',
|
yellow_lightest = to_hex("rgb(243, 234, 206)"),
|
||||||
blue_lightest = '#d2e4e5',
|
blue_lightest = to_hex("rgb(210, 228, 229)"),
|
||||||
purple_lightest = '#f2dee7',
|
purple_lightest = to_hex("rgb(242, 222, 231)"),
|
||||||
aqua_lightest = '#d4e3d4',
|
aqua_lightest = to_hex("rgb(212, 227, 212)"),
|
||||||
orange_lightest = '#f3e0d3',
|
orange_lightest = to_hex("rgb(243, 224, 211)"),
|
||||||
}
|
}
|
||||||
|
|
||||||
local is_dark = vim.opt.background:get() == 'dark'
|
local is_dark = vim.opt.background:get() == 'dark'
|
||||||
|
@ -67,7 +74,9 @@ M.colors = function()
|
||||||
palette['bg' .. tostring(i)] = c[(is_dark and 'dark' or 'light') .. tostring(i)]
|
palette['bg' .. tostring(i)] = c[(is_dark and 'dark' or 'light') .. tostring(i)]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
palette['fg0_h'] = c[(is_dark and 'light' or 'dark') .. '0_h']
|
||||||
palette['fg0_s'] = c[(is_dark and 'light' or 'dark') .. '0_s']
|
palette['fg0_s'] = c[(is_dark and 'light' or 'dark') .. '0_s']
|
||||||
|
palette['bg0_h'] = c[(is_dark and 'dark' or 'light') .. '0_h']
|
||||||
palette['bg0_s'] = c[(is_dark and 'dark' or 'light') .. '0_s']
|
palette['bg0_s'] = c[(is_dark and 'dark' or 'light') .. '0_s']
|
||||||
|
|
||||||
for _, accent in ipairs({'red', 'green', 'yellow', 'blue', 'purple', 'aqua', 'orange'}) do
|
for _, accent in ipairs({'red', 'green', 'yellow', 'blue', 'purple', 'aqua', 'orange'}) do
|
||||||
|
@ -83,12 +92,12 @@ end
|
||||||
M.highlights = function()
|
M.highlights = function()
|
||||||
local C = M.colors()
|
local C = M.colors()
|
||||||
local fg = C.fg3
|
local fg = C.fg3
|
||||||
local bg = C.bg0
|
local bg = C.bg0_h
|
||||||
|
|
||||||
return {
|
return {
|
||||||
standard = {
|
standard = {
|
||||||
Normal = { fg = fg, bg = bg }, -- normal text
|
Normal = { fg = fg, bg = bg }, -- normal text
|
||||||
NormalNC = { fg = fg, bg = C.bg0_s }, -- normal text in non-current windows
|
NormalNC = { fg = fg, bg = C.bg0 }, -- normal text in non-current windows
|
||||||
|
|
||||||
NormalFloat = { link = 'Normal' }, -- floating windows
|
NormalFloat = { link = 'Normal' }, -- floating windows
|
||||||
FloatBorder = { fg = C.gray, bg = bg },
|
FloatBorder = { fg = C.gray, bg = bg },
|
||||||
|
@ -155,8 +164,8 @@ M.highlights = function()
|
||||||
TermCursor = { link = 'Cursor' },
|
TermCursor = { link = 'Cursor' },
|
||||||
|
|
||||||
LineNr = { fg = C.bg3 },
|
LineNr = { fg = C.bg3 },
|
||||||
CursorLine = { bg = C.bg0_s },
|
CursorLine = { bg = C.bg0 },
|
||||||
CursorLineNr = { bg = C.bg0_s, fg = C.fg2 },
|
CursorLineNr = { bg = C.bg0, fg = C.fg2 },
|
||||||
|
|
||||||
IncSearch = { link = 'CurSearch' },
|
IncSearch = { link = 'CurSearch' },
|
||||||
CurSearch = { fg = C.purple_bg, bg = C.br_purple, bold = true },
|
CurSearch = { fg = C.purple_bg, bg = C.br_purple, bold = true },
|
||||||
|
@ -195,7 +204,7 @@ M.highlights = function()
|
||||||
|
|
||||||
Directory = { fg = C.blue },
|
Directory = { fg = C.blue },
|
||||||
|
|
||||||
NonText = { fg = C.bg1 }, -- subtle EOL symbols
|
NonText = { fg = C.bg3 }, -- subtle EOL symbols
|
||||||
Whitespace = { fg = C.orange }, -- listchars
|
Whitespace = { fg = C.orange }, -- listchars
|
||||||
QuickFixLine = { fg = C.yellow , bg = C.bg2 }, -- selected quickfix item
|
QuickFixLine = { fg = C.yellow , bg = C.bg2 }, -- selected quickfix item
|
||||||
|
|
||||||
|
@ -638,8 +647,9 @@ M.highlights = function()
|
||||||
|
|
||||||
-- 'lukas-reineke/virt-column.nvim'
|
-- 'lukas-reineke/virt-column.nvim'
|
||||||
virt_column = {
|
virt_column = {
|
||||||
VirtColumn = { fg = C.bg1 }, -- virtual column
|
VirtColumn1 = { fg = C.bg1 },
|
||||||
ColorColumn = {}, -- otherwise this is visible behind VirtColumn
|
VirtColumn2 = { fg = C.dim_yellow, bg = C.bg0 },
|
||||||
|
VirtColumn3 = { fg = C.dim_red, bg = C.orange_bg },
|
||||||
},
|
},
|
||||||
|
|
||||||
-- 'kyazdani42/nvim-tree.lua'
|
-- 'kyazdani42/nvim-tree.lua'
|
||||||
|
|
|
@ -2,25 +2,25 @@ local C = require 'gruvbox'.colors()
|
||||||
|
|
||||||
return {
|
return {
|
||||||
normal = {
|
normal = {
|
||||||
a = { fg = C.bg0, bg = C.blue, bold = true },
|
a = { fg = C.bg0_h, bg = C.blue, bold = true },
|
||||||
b = { fg = C.fg2, bg = C.bg2 },
|
b = { fg = C.fg2, bg = C.bg1 },
|
||||||
c = { fg = C.fg2, bg = C.bg1 },
|
c = { fg = C.fg2, bg = C.bg0_s },
|
||||||
},
|
},
|
||||||
insert = {
|
insert = {
|
||||||
a = { fg = C.bg0, bg = C.green, bold = true },
|
a = { fg = C.bg0_h, bg = C.green, bold = true },
|
||||||
},
|
},
|
||||||
visual = {
|
visual = {
|
||||||
a = { fg = C.bg0, bg = C.purple, bold = true },
|
a = { fg = C.bg0_h, bg = C.purple, bold = true },
|
||||||
},
|
},
|
||||||
replace = {
|
replace = {
|
||||||
a = { fg = C.bg0, bg = C.red, bold = true },
|
a = { fg = C.bg0_h, bg = C.red, bold = true },
|
||||||
},
|
},
|
||||||
command = {
|
command = {
|
||||||
a = { fg = C.bg0, bg = C.yellow, bold = true },
|
a = { fg = C.bg0_h, bg = C.yellow, bold = true },
|
||||||
},
|
},
|
||||||
inactive = {
|
inactive = {
|
||||||
a = { fg = C.fg4, bg = C.bg2 },
|
a = { fg = C.fg4, bg = C.bg2 },
|
||||||
b = { fg = C.fg4, bg = C.bg2 },
|
b = { fg = C.fg4, bg = C.bg1 },
|
||||||
c = { fg = C.fg4, bg = C.bg1 },
|
c = { fg = C.fg4, bg = C.bg0_s },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue