feat: add Neovim integrated terminal colors
This commit is contained in:
parent
a06a2a7ea2
commit
440a37c272
@ -21,6 +21,9 @@ function M.load()
|
||||
|
||||
-- set highlights here...
|
||||
local highlights = require("gruber-darker.hl")
|
||||
|
||||
highlights.setup()
|
||||
|
||||
for group, hl in pairs(highlights.groups) do
|
||||
vim.api.nvim_set_hl(0, group, hl)
|
||||
end
|
@ -3,7 +3,42 @@ local config = require("gruber-darker.config").get_resolved_opts()
|
||||
|
||||
local M = {}
|
||||
|
||||
M.groups = {
|
||||
---Set Neovim terminal colors
|
||||
local function set_terminal_colors()
|
||||
-- terminal colors adapted from
|
||||
-- https://github.com/drsooch/gruber-darker-vim/blob/master/colors/GruberDarker.vim#L202
|
||||
vim.g.terminal_color_0 = c.default["bg+1"]
|
||||
vim.g.terminal_color_8 = c.default["bg+1"]
|
||||
|
||||
vim.g.terminal_color_1 = c.default["red+1"]
|
||||
vim.g.terminal_color_9 = c.default["red+1"]
|
||||
|
||||
vim.g.terminal_color_2 = c.default.green
|
||||
vim.g.terminal_color_10 = c.default.green
|
||||
|
||||
vim.g.terminal_color_3 = c.default.yellow
|
||||
vim.g.terminal_color_11 = c.default.yellow
|
||||
|
||||
vim.g.terminal_color_4 = c.default.niagara
|
||||
vim.g.terminal_color_12 = c.default.niagara
|
||||
|
||||
vim.g.terminal_color_5 = c.default.purple
|
||||
vim.g.terminal_color_13 = c.default.purple
|
||||
|
||||
vim.g.terminal_color_6 = c.default.niagara
|
||||
vim.g.terminal_color_14 = c.default.niagara
|
||||
|
||||
vim.g.terminal_color_7 = c.default.fg
|
||||
vim.g.terminal_color_15 = c.default.fg
|
||||
|
||||
vim.g.terminal_color_background = c.default["bg+1"]
|
||||
vim.g.terminal_color_foreground = c.default.white
|
||||
end
|
||||
|
||||
function M.setup()
|
||||
set_terminal_colors()
|
||||
|
||||
M.groups = {
|
||||
Comment = { fg = c.default.brown, italic = config.comment_italics and config.italic }, -- any comment
|
||||
ColorColumn = { bg = c.default["bg+2"] }, -- used for the columns set with 'colorcolumn'
|
||||
Conceal = { fg = c.default.fg, bg = c.default.bg }, -- placeholder characters substituted for concealed text (see 'conceallevel')
|
||||
@ -66,7 +101,6 @@ M.groups = {
|
||||
WarningMsg = { fg = c.default.red }, -- warning messages
|
||||
Whitespace = { fg = c.default["bg+4"], bg = c.default.none }, -- "nbsp", "space", "tab" and "trail" in 'listchars'
|
||||
WildMenu = { fg = c.default.black, bg = c.default.yellow }, -- current match in 'wildmenu' completion
|
||||
|
||||
-- These groups are not listed as default vim groups,
|
||||
-- but they are defacto standard group names for syntax highlighting.
|
||||
-- commented out groups should chain up to their "preferred" group by
|
||||
@ -79,10 +113,8 @@ M.groups = {
|
||||
Number = { fg = c.default.fg }, -- a number constant: 234, 0xff
|
||||
Boolean = { fg = c.default.yellow, bold = config.bold }, -- a boolean constant: TRUE, false
|
||||
Float = { fg = c.default.yellow, bold = config.bold }, -- a floating point constant: 2.3e10
|
||||
|
||||
Identifier = { fg = c.default["fg+1"] }, -- (preferred) any variable name
|
||||
Function = { fg = c.default.niagara }, -- function name (also: methods for classes)
|
||||
|
||||
Statement = { fg = c.default.yellow }, -- (preferred) any statement
|
||||
Conditional = { fg = c.default.yellow, bold = config.bold }, -- if, then, else, endif, switch, etc.
|
||||
Repeat = { fg = c.default.yellow, bold = config.bold }, -- for, do, while, etc.
|
||||
@ -90,18 +122,15 @@ M.groups = {
|
||||
Operator = { fg = c.default.yellow }, -- "sizeof", "+", "*", etc.
|
||||
Keyword = { fg = c.default.yellow, bold = config.bold }, -- any other keyword
|
||||
Exception = { fg = c.default.yellow, bold = config.bold }, -- try, catch, throw
|
||||
|
||||
PreProc = { fg = c.default.quartz }, -- (preferred) generic Preprocessor
|
||||
Include = { fg = c.default.quartz }, -- preprocessor #include
|
||||
Define = { fg = c.default.quartz }, -- preprocessor #define
|
||||
Macro = { fg = c.default.quartz }, -- same as Define
|
||||
PreCondit = { fg = c.default.quartz }, -- preprocessor #if, #else, #endif, etc.
|
||||
|
||||
Type = { fg = c.default.quartz }, -- (preferred) int, long, char, etc.
|
||||
StorageClass = { fg = c.default.yellow, bold = config.bold }, -- static, register, volatile, etc.
|
||||
Structure = { fg = c.default.yellow, bold = config.bold }, -- struct, union, enum, etc.
|
||||
Typedef = { fg = c.default.yellow, bold = config.bold }, -- A typedef
|
||||
|
||||
Special = { fg = c.default.yellow }, -- (preferred) any special symbol
|
||||
-- SpecialChar = { }, -- special character in a constant
|
||||
-- Tag = { }, -- you can use CTRL-] on this
|
||||
@ -112,13 +141,11 @@ M.groups = {
|
||||
Underlined = { underline = config.underline }, -- (preferred) text that stands out, HTML links
|
||||
Bold = { bold = config.bold },
|
||||
Italic = { italic = config.italic },
|
||||
|
||||
-- ("Ignore", below, may be invisible...)
|
||||
-- Ignore = { }, -- (preferred) left blank, hidden |hl-Ignore|
|
||||
|
||||
-- Error = { fg = c.error }, -- (preferred) any erroneous construct
|
||||
Todo = { fg = c.default.bg, bg = c.default.yellow }, -- (preferred) anything that needs extra attention; mostly the keywords TODO FIXME and XXX
|
||||
|
||||
markdownHeadingDelimiter = { fg = c.default.niagara, bold = config.bold },
|
||||
markdownCode = { fg = c.default.green },
|
||||
markdownCodeBlock = { fg = c.default.green },
|
||||
@ -129,7 +156,6 @@ M.groups = {
|
||||
markdownBold = { fg = c.default.yellow, bold = config.bold },
|
||||
markdownCodeDelimiter = { fg = c.default.brown, italic = config.italic },
|
||||
markdownError = { fg = c.default.fg, bg = c.default["bg+1"] },
|
||||
|
||||
-- These groups are for the neovim tree-sitter highlights.
|
||||
-- As of writing, tree-sitter support is a WIP, group names may change.
|
||||
-- By default, most of these groups link to an appropriate Vim group,
|
||||
@ -194,7 +220,6 @@ M.groups = {
|
||||
["@text.diff.add"] = { link = "DiffAdd" },
|
||||
["@text.diff.delete"] = { link = "DiffDelete" },
|
||||
["@text.diff.change"] = { link = "DiffChange" },
|
||||
|
||||
-- Cmp
|
||||
-- CmpDocumentation = { link = "NormalFloat" },
|
||||
-- CmpDocumentationBorder = { link = "FloatBorder" },
|
||||
@ -234,6 +259,7 @@ M.groups = {
|
||||
-- CmpItemKindEnumMember = { fg = c.green1, bg = c.none },
|
||||
-- CmpItemKindOperator = { fg = c.green1, bg = c.none },
|
||||
-- CmpItemKindSnippet = { fg = c.dark5, bg = c.none },
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
return M
|
||||
|
Loading…
Reference in New Issue
Block a user