diff --git a/README.md b/README.md index eea8182..f742d0b 100644 --- a/README.md +++ b/README.md @@ -38,12 +38,16 @@ vim.cmd.colorscheme("gruber-darker") ```lua { bold = true, + inverse = { + signs = true, + }, italic = { strings = true, comments = true, operators = false, folds = true, }, + undercurl = true, underline = true, } ``` diff --git a/lua/gruber-darker/config.lua b/lua/gruber-darker/config.lua index 1a52882..ff54a3e 100644 --- a/lua/gruber-darker/config.lua +++ b/lua/gruber-darker/config.lua @@ -4,8 +4,13 @@ ---|"operators" ---|"folds" +---@alias InvertType +---|"signs" +---|"tabline" + ---@class GruberDarkerOpts ---@field bold boolean +---@field invert table ---@field italic table ---@field undercurl boolean ---@field underline boolean @@ -13,13 +18,17 @@ ---@type GruberDarkerOpts local DEFAULTS = { bold = true, + invert = { + signs = true, + tabline = false, + }, italic = { strings = true, comments = true, operators = false, folds = true, }, - -- undercurl = true, + undercurl = true, underline = true, } diff --git a/lua/gruber-darker/highlights/colorscheme.lua b/lua/gruber-darker/highlights/colorscheme.lua new file mode 100644 index 0000000..1e93d87 --- /dev/null +++ b/lua/gruber-darker/highlights/colorscheme.lua @@ -0,0 +1,82 @@ +local Highlight = require("gruber-darker.highlight") +local c = require("gruber-darker.palette").default +local config = require("gruber-darker.config").get_opts() + +---@type HighlightsProvider +local M = { + highlights = {}, +} + +---Set GruberDarker-specific highlights +function M.setup() + for _, value in pairs(M.highlights) do + value:setup() + end +end + +-- Highlights inspired by +-- https://github.com/ellisonleao/gruvbox.nvim/blob/main/lua/gruvbox/groups.lua#L43 + +-- Colors + +M.highlights.fg0 = Highlight.new("GruberDarkerFg0", { fg = c.fg }) +M.highlights.fg1 = Highlight.new("GruberDarkerFg1", { fg = c["fg+1"] }) +M.highlights.fg2 = Highlight.new("GruberDarkerFg2", { fg = c["fg+2"] }) + +M.highlights.bg_1 = Highlight.new("GruberDarkerBg-1", { fg = c["bg-1"] }) +M.highlights.bg0 = Highlight.new("GruberDarkerBg0", { fg = c.bg }) +M.highlights.bg1 = Highlight.new("GruberDarkerBg1", { fg = c["bg+1"] }) +M.highlights.bg2 = Highlight.new("GruberDarkerBg2", { fg = c["bg+2"] }) +M.highlights.bg3 = Highlight.new("GruberDarkerBg3", { fg = c["bg+3"] }) +M.highlights.bg4 = Highlight.new("GruberDarkerBg4", { fg = c["bg+4"] }) + +M.highlights.dark_red = Highlight.new("GruberDarkerDarkRed", { fg = c["red-1"] }) +M.highlights.dark_red_bold = Highlight.new("GruberDarkerDarkRedBold", { fg = c["red-1"], bold = config.bold }) +M.highlights.red = Highlight.new("GruberDarkerRed", { fg = c.red }) +M.highlights.red_bold = Highlight.new("GruberDarkerRedBold", { fg = c.red, bold = config.bold }) +M.highlights.light_red = Highlight.new("GruberDarkerLightRed", { fg = c["red+1"] }) +M.highlights.light_red_bold = Highlight.new("GruberDarkerLightRedBold", { fg = c["red+1"], bold = config.bold }) + +M.highlights.green = Highlight.new("GruberDarkerGreen", { fg = c.green }) +M.highlights.green_bold = Highlight.new("GruberDarkerGreenBold", { fg = c.green, bold = config.bold }) + +M.highlights.yellow = Highlight.new("GruberDarkerYellow", { fg = c.yellow }) +M.highlights.green_bold = Highlight.new("GruberDarkerYellowBold", { fg = c.yellow, bold = config.bold }) + +M.highlights.brown = Highlight.new("GruberDarkerBrown", { fg = c.brown }) +M.highlights.brown_bold = Highlight.new("GruberDarkerBrownBold", { fg = c.brown, bold = config.bold }) + +M.highlights.quartz = Highlight.new("GruberDarkerQuartz", { fg = c.quartz }) +M.highlights.quartz_bold = Highlight.new("GruberDarkerQuartzBold", { fg = c.quartz, bold = config.bold }) + +M.highlights.darker_niagara = Highlight.new("GruberDarkerDarkestNiagara", { fg = c["niagara-2"] }) +M.highlights.darker_niagara_bold = + Highlight.new("GruberDarkerDarkestNiagaraBold", { fg = c["niagara-2"], bold = config.bold }) +M.highlights.dark_niagara = Highlight.new("GruberDarkerDarkNiagara", { fg = c["niagara-1"] }) +M.highlights.dark_niagara_bold = + Highlight.new("GruberDarkerDarkNiagaraBold", { fg = c["niagara-1"], bold = config.bold }) +M.highlights.niagara = Highlight.new("GruberDarkerNiagara", { fg = c.niagara }) +M.highlights.niagara_bold = Highlight.new("GruberDarkerNiagaraBold", { fg = c.niagara, bold = config.bold }) + +M.highlights.wisteria = Highlight.new("GruberDarkerWisteria", { fg = c.wisteria }) +M.highlights.wisteria_bold = Highlight.new("GruberDarkerWisteriaBold", { fg = c.wisteria, bold = config.bold }) + +-- Signs + +M.highlights.red_sign = Highlight.new("GruberDarkerRedSign", { fg = c.red, bg = c.bg, reverse = config.invert.signs }) +M.highlights.quartz_sign = + Highlight.new("GruberDarkerQuartzSign", { fg = c.quartz, bg = c.bg, reverse = config.invert.signs }) +M.highlights.niagara_sign = + Highlight.new("GruberDarkerNiagaraSign", { fg = c.niagara, bg = c.bg, reverse = config.invert.signs }) +M.highlights.wisteria_sign = + Highlight.new("GruberDarkerWisteriaSign", { fg = c.wisteria, bg = c.bg, reverse = config.invert.signs }) + +-- Underlines + +M.highlights.red_underline = Highlight.new("GruberDarkerRedUnderline", { sp = c.red, undercurl = config.undercurl }) +M.highlights.quartz_underline = + Highlight.new("GruberDarkerQuartzUnderline", { sp = c.quartz, undercurl = config.undercurl }) +M.highlights.niagara_underline = + Highlight.new("GruberDarkerNiagaraUnderline", { sp = c.niagara, undercurl = config.undercurl }) +M.highlights.wisteria_underline = + Highlight.new("GruberDarkerWisteriaUnderline", { sp = c.wisteria, undercurl = config.undercurl }) diff --git a/lua/gruber-darker/highlights/init.lua b/lua/gruber-darker/highlights/init.lua index 643f7c9..2dd8d09 100644 --- a/lua/gruber-darker/highlights/init.lua +++ b/lua/gruber-darker/highlights/init.lua @@ -1,6 +1,11 @@ local M = {} +---@class HighlightsProvider +---@field highlights table + +---@type HighlightsProvider[] local providers = { + -- require("gruber-darker.highlights.colorscheme"), require("gruber-darker.highlights.vim"), require("gruber-darker.highlights.terminal"), require("gruber-darker.highlights.treesitter"), @@ -8,8 +13,8 @@ local providers = { ---Set highlights for configured providers function M.setup() - for _, highlights in ipairs(providers) do - highlights:setup() + for _, provider in ipairs(providers) do + provider:setup() end end diff --git a/lua/gruber-darker/highlights/terminal.lua b/lua/gruber-darker/highlights/terminal.lua index 0cf1f77..17e6af6 100644 --- a/lua/gruber-darker/highlights/terminal.lua +++ b/lua/gruber-darker/highlights/terminal.lua @@ -1,5 +1,6 @@ local c = require("gruber-darker.palette") +---@type HighlightsProvider local M = {} ---Set Neovim terminal colors diff --git a/lua/gruber-darker/highlights/treesitter.lua b/lua/gruber-darker/highlights/treesitter.lua index 0f8c68f..91cc240 100644 --- a/lua/gruber-darker/highlights/treesitter.lua +++ b/lua/gruber-darker/highlights/treesitter.lua @@ -1,10 +1,10 @@ -local c = require("gruber-darker.palette") +local c = require("gruber-darker.palette").default local opts = require("gruber-darker.config").get_opts() local vim_hl = require("gruber-darker.highlights.vim").highlights local Highlight = require("gruber-darker.highlight") +---@type HighlightsProvider local M = { - ---@type table highlights = {}, } @@ -17,21 +17,21 @@ end -- 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, +-- By, most of these groups link to an appropriate Vim group, -- TSError -> Error for example, so you do not have to define these unless -- you explicitly want to support Treesitter's improved syntax awareness. -- TSAnnotation = Highlight.new("", { }) -- For C++/Dart attributes, annotations that can be attached to the code to denote some kind of meta information. -- TSAttribute = Highlight.new("", { }) -- (unstable) TODO: docs -M.highlights.boolean = Highlight.new("TSBoolean", { fg = c.default.quartz }) -- For booleans. +M.highlights.boolean = Highlight.new("TSBoolean", { fg = c.quartz }) -- For booleans. M.highlights.character = Highlight.new("TSCharacter", { link = vim_hl.character }) -- For characters. M.highlights.comment = Highlight.new("TSComment", { link = vim_hl.comment }) -- For comment blocks. -- TSNote = Highlight.new("TSNote", { fg = c.bg, bg = c.info }) -M.highlights.text_warning = Highlight.new("@text.warning", { fg = c.default.red }) -M.highlights.text_danger = Highlight.new("@text.danger", { fg = c.default.white, bg = c.default.red }) +M.highlights.text_warning = Highlight.new("@text.warning", { fg = c.red }) +M.highlights.text_danger = Highlight.new("@text.danger", { fg = c.white, bg = c.red }) -- ["@constructor"] = Highlight.new("", { fg = c.magenta }, -- For constructor calls and definitions: `= { })` in Lua, and Java constructors. -M.highlights.conditional = Highlight.new("TSConditional", { fg = c.default.yellow }) -- For keywords related to conditionnals. -M.highlights.constant = Highlight.new("TSConstant", { fg = c.default.quartz }) -- For constants +M.highlights.conditional = Highlight.new("TSConditional", { fg = c.yellow }) -- For keywords related to conditionnals. +M.highlights.constant = Highlight.new("TSConstant", { fg = c.quartz }) -- For constants -- TSConstBuiltin = Highlight.new("", { }) -- For constant that are built in the language: `nil` in Lua. -- TSConstMacro = Highlight.new("", { }) -- For constants that are defined by macros: `NULL` in C. -- TSError = Highlight.new("", { }) -- For syntax/parser errors. @@ -66,7 +66,7 @@ M.highlights.string = Highlight.new("TSString", { link = vim_hl.string }) -- TSSymbol = Highlight.new("", { }) -- For identifiers referring to symbols or atoms. ---For types. -M.highlights.type = Highlight.new("TSType", { fg = c.default.quartz }) +M.highlights.type = Highlight.new("TSType", { fg = c.quartz }) -- TSTypeBuiltin = Highlight.new("", { }) -- For builtin types. -- ["@variable"] = Highlight.new("", { style = options.styles.variables }) -- Any variable name that does not have another highlight. -- ["@variable.builtin"] = Highlight.new("", { fg = c.red }) -- Variable names that are defined by the languages, like `this` or `self`. @@ -82,7 +82,7 @@ M.highlights.type = Highlight.new("TSType", { fg = c.default.quartz }) -- TSLiteral = Highlight.new("", { }) -- Literal text. ---Any URI like a link or email. -M.highlights.uri = Highlight.new("TSURI", { fg = c.default.niagara, underline = opts.underline }) +M.highlights.uri = Highlight.new("TSURI", { fg = c.niagara, underline = opts.underline }) M.highlights.text_diff_add = Highlight.new("@text.diff.add", { link = vim_hl.diff_add }) M.highlights.text_diff_delete = Highlight.new("@text.diff.delete", { link = vim_hl.diff_delete }) diff --git a/lua/gruber-darker/highlights/vim.lua b/lua/gruber-darker/highlights/vim.lua index d5dda2d..5d0e6c9 100644 --- a/lua/gruber-darker/highlights/vim.lua +++ b/lua/gruber-darker/highlights/vim.lua @@ -1,9 +1,9 @@ local Highlight = require("gruber-darker.highlight") -local c = require("gruber-darker.palette") +local c = require("gruber-darker.palette").default local opts = require("gruber-darker.config").get_opts() +---@type HighlightsProvider local M = { - ---@type table highlights = {}, } @@ -15,94 +15,93 @@ function M.setup() end ---any comment -M.highlights.comment = Highlight.new("Comment", { fg = c.default.brown, italic = opts.italic.comments }) +M.highlights.comment = Highlight.new("Comment", { fg = c.brown, italic = opts.italic.comments }) ---used for the columns set with 'colorcolumn' -M.highlights.color_column = Highlight.new("ColorColumn", { bg = c.default["bg+2"] }) +M.highlights.color_column = Highlight.new("ColorColumn", { bg = c["bg+2"] }) ---placeholder characters substituted for concealed text (see 'conceallevel') -M.highlights.conceal = Highlight.new("Conceal", { fg = c.default.fg, bg = c.default.bg }) +M.highlights.conceal = Highlight.new("Conceal", { fg = c.fg, bg = c.bg }) ---character under the cursor -M.highlights.cursor = Highlight.new("Cursor", { bg = c.default.yellow }) +M.highlights.cursor = Highlight.new("Cursor", { bg = c.yellow }) ---the character under the cursor when |language-mapping| is used (see 'guicursor') -M.highlights.l_cursor = Highlight.new("lCursor", { fg = c.default.none, bg = c.default.yellow }) +M.highlights.l_cursor = Highlight.new("lCursor", { fg = c.none, bg = c.yellow }) ---like Cursor, but used when in IME mode |CursorIM| -M.highlights.cursor_im = Highlight.new("CursorIM", { fg = c.default.none, bg = c.default.yellow }) +M.highlights.cursor_im = Highlight.new("CursorIM", { fg = c.none, bg = c.yellow }) ---Screen-column at the cursor, when 'cursorcolumn' is set. -M.highlights.cursor_column = Highlight.new("CursorColumn", { bg = c.default["bg+2"] }) +M.highlights.cursor_column = Highlight.new("CursorColumn", { bg = c["bg+2"] }) ---Screen-line at the cursor, when 'cursorline' is set. Low-priority if foreground (ctermfg OR guifg) is not set. -M.highlights.cursor_line = Highlight.new("CursorLine", { bg = c.default["bg+1"] }) ----Directory = Highlight.new("Directory", { fg = c.default.lightblue }) ---directory names (and other special names in listings) +M.highlights.cursor_line = Highlight.new("CursorLine", { bg = c["bg+1"] }) +---Directory = Highlight.new("Directory", { fg = c.lightblue }) ---directory names (and other special names in listings) ---diff mode: Added line |diff.txt| -M.highlights.diff_add = Highlight.new("DiffAdd", { fg = c.default.green, bg = c.default.none }) +M.highlights.diff_add = Highlight.new("DiffAdd", { fg = c.green, bg = c.none }) ---diff mode: Changed line |diff.txt| -M.highlights.diff_change = Highlight.new("DiffChange", { fg = c.default.yellow, bg = c.default.none }) +M.highlights.diff_change = Highlight.new("DiffChange", { fg = c.yellow, bg = c.none }) ---diff mode: Deleted line |diff.txt| -M.highlights.diff_delete = Highlight.new("DiffDelete", { fg = c.default["red+1"], bg = c.default.none }) +M.highlights.diff_delete = Highlight.new("DiffDelete", { fg = c["red+1"], bg = c.none }) ---diff mode: Changed text within a changed line |diff.txt| -M.highlights.diff_text = Highlight.new("DiffText", { fg = c.default.yellow, bg = c.default.none }) ----filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|. -M.highlights.end_of_buffer = Highlight.new("EndOfBuffer", { fg = c.default["bg+4"], bg = c.default.none }) +M.highlights.diff_text = Highlight.new("DiffText", { fg = c.yellow, bg = c.none }) +---filler lines (~) after the end of the buffer. By, this is highlighted like |hl-NonText|. +M.highlights.end_of_buffer = Highlight.new("EndOfBuffer", { fg = c["bg+4"], bg = c.none }) ---cursor in a focused terminal -M.highlights.term_cursor = Highlight.new("TermCursor", { bg = c.default.yellow }) +M.highlights.term_cursor = Highlight.new("TermCursor", { bg = c.yellow }) ---TermCursorNC= { }, ---cursor in an unfocused terminal ---error messages on the command line -M.highlights.error_msg = Highlight.new("ErrorMsg", { fg = c.default.white, bg = c.default.red }) +M.highlights.error_msg = Highlight.new("ErrorMsg", { fg = c.white, bg = c.red }) ---the column separating vertically split windows -M.highlights.vert_split = Highlight.new("VertSplit", { fg = c.default["fg+2"], bg = c.default["bg+1"] }) +M.highlights.vert_split = Highlight.new("VertSplit", { fg = c["fg+2"], bg = c["bg+1"] }) ---the column separating vertically split windows -M.highlights.win_separator = Highlight.new("WinSeparator", { fg = c.default["bg+2"], bold = opts.bold }) +M.highlights.win_separator = Highlight.new("WinSeparator", { fg = c["bg+2"], bold = opts.bold }) ---line used for closed folds -M.highlights.folded = - Highlight.new("Folded", { fg = c.default.brown, bg = c.default["fg+2"], italic = opts.italic.folds }) +M.highlights.folded = Highlight.new("Folded", { fg = c.brown, bg = c["fg+2"], italic = opts.italic.folds }) ---'foldcolumn' -M.highlights.fold_column = Highlight.new("FoldColumn", { fg = c.default.brown, bg = c.default["fg+2"] }) +M.highlights.fold_column = Highlight.new("FoldColumn", { fg = c.brown, bg = c["fg+2"] }) ---column where |signs| are displayed -M.highlights.sign_column = Highlight.new("SignColumn", { fg = c.default["bg+2"], bg = c.default.none }) +M.highlights.sign_column = Highlight.new("SignColumn", { fg = c["bg+2"], bg = c.none }) ---SignColumnSB = Highlight.new("SignColumnSB", { bg = c.bg_sidebar, fg = c.fg_gutter }) ---column where |signs| are displayed ---Substitute = Highlight.new("Substitute", { bg = c.red, fg = c.black }) ---|:substitute| replacement text highlighting ---Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set. -M.highlights.line_number = Highlight.new("LineNr", { fg = c.default["bg+4"] }) +M.highlights.line_number = Highlight.new("LineNr", { fg = c["bg+4"] }) ---Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line. -M.highlights.cursor_line_number = Highlight.new("CursorLineNr", { fg = c.default.yellow }) +M.highlights.cursor_line_number = Highlight.new("CursorLineNr", { fg = c.yellow }) ---The character under the cursor or just before it, if it is a paired bracket, and its match. |pi_paren.txt| -M.highlights.match_paren = Highlight.new("MatchParen", { fg = c.default.fg, bg = c.default.wisteria }) +M.highlights.match_paren = Highlight.new("MatchParen", { fg = c.fg, bg = c.wisteria }) ---'showmode' message (e.g., "---INSERT ---") -M.highlights.mode_msg = Highlight.new("ModeMsg", { fg = c.default["fg+2"] }) +M.highlights.mode_msg = Highlight.new("ModeMsg", { fg = c["fg+2"] }) ---MsgArea = Highlight.new("MsgArea", { fg = c.fg_dark }) ---Area for messages and cmdline ---MsgSeparator= { }, ---Separator for scrolled messages, `msgsep` flag of 'display' ---|more-prompt| -M.highlights.more_msg = Highlight.new("MoreMsg", { fg = c.default["fg+2"] }) +M.highlights.more_msg = Highlight.new("MoreMsg", { fg = c["fg+2"] }) ---'@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., ">" displayed when a double-wide character doesn't fit at the end of the line). See also |hl-EndOfBuffer|. -M.highlights.non_text = Highlight.new("NonText", { fg = c.default["fg+2"] }) +M.highlights.non_text = Highlight.new("NonText", { fg = c["fg+2"] }) ---normal text -M.highlights.normal = Highlight.new("Normal", { fg = c.default.fg, bg = c.default.bg }) +M.highlights.normal = Highlight.new("Normal", { fg = c.fg, bg = c.bg }) ---normal text in non-current windows -M.highlights.normal_non_current = Highlight.new("NormalNC", { fg = c.default.fg, bg = c.default["bg-1"] }) +M.highlights.normal_non_current = Highlight.new("NormalNC", { fg = c.fg, bg = c["bg-1"] }) ---normal text in sidebar -M.highlights.normal_sidebar = Highlight.new("NormalSB", { fg = c.default.fg, bg = c.default["bg-1"] }) +M.highlights.normal_sidebar = Highlight.new("NormalSB", { fg = c.fg, bg = c["bg-1"] }) ---Normal text in floating windows. -M.highlights.normal_float = Highlight.new("NormalFloat", { fg = c.default.fg, bg = c.default.bg }) -M.highlights.float_border = Highlight.new("FloatBorder", { fg = c.default["bg+2"], bg = c.default["bg-1"] }) +M.highlights.normal_float = Highlight.new("NormalFloat", { fg = c.fg, bg = c.bg }) +M.highlights.float_border = Highlight.new("FloatBorder", { fg = c["bg+2"], bg = c["bg-1"] }) ---Popup menu: normal item. -M.highlights.popup_menu = Highlight.new("Pmenu", { fg = c.default.fg, bg = c.default["bg+1"] }) +M.highlights.popup_menu = Highlight.new("Pmenu", { fg = c.fg, bg = c["bg+1"] }) ---Popup menu: selected item. -M.highlights.popup_menu_sel = Highlight.new("PmenuSel", { fg = c.default.fg, bg = c.default["bg+2"] }) +M.highlights.popup_menu_sel = Highlight.new("PmenuSel", { fg = c.fg, bg = c["bg+2"] }) ---Popup menu: scrollbar. -M.highlights.popup_menu_sidebar = Highlight.new("PmenuSbar", { bg = c.default.bg }) +M.highlights.popup_menu_sidebar = Highlight.new("PmenuSbar", { bg = c.bg }) ---Popup menu: Thumb of the scrollbar. -M.highlights.popup_menu_thumb = Highlight.new("PmenuThumb", { bg = c.default.bg }) +M.highlights.popup_menu_thumb = Highlight.new("PmenuThumb", { bg = c.bg }) ---|hit-enter| prompt and yes/no questions -M.highlights.question = Highlight.new("Question", { fg = c.default.niagara }) +M.highlights.question = Highlight.new("Question", { fg = c.niagara }) ---Current |quickfix| item in the quickfix window. Combined with |hl-CursorLine| when the cursor is there. -M.highlights.quick_fix_line = Highlight.new("QuickFixLine", { bg = c.default["bg+2"], bold = opts.bold }) +M.highlights.quick_fix_line = Highlight.new("QuickFixLine", { bg = c["bg+2"], bold = opts.bold }) ---Last search pattern highlighting (see 'hlsearch'). Also used for similar items that need to stand out. -M.highlights.search = Highlight.new("Search", { fg = c.default.black, bg = c.default.yellow }) +M.highlights.search = Highlight.new("Search", { fg = c.black, bg = c.yellow }) ---'incsearch' highlighting; also used for the text replaced with ":s///c" -M.highlights.incremental_search = Highlight.new("IncSearch", { fg = c.default.black, bg = c.default["fg+2"] }) +M.highlights.incremental_search = Highlight.new("IncSearch", { fg = c.black, bg = c["fg+2"] }) M.highlights.current_search = Highlight.new("CurSearch", { link = M.highlights.incremental_search }) ---Unprintable characters: text displayed differently from what it really is. But not 'listchars' whitespace. |hl-Whitespace| -M.highlights.special_key = Highlight.new("SpecialKey", { fg = c.default["fg+2"] }) +M.highlights.special_key = Highlight.new("SpecialKey", { fg = c["fg+2"] }) ---Word that is not recognized by the spellchecker. |spell| Combined with the highlighting used otherwise. M.highlights.spell_bad = Highlight.new("SpellBad", { undercurl = true }) ---Word that should start with a capital. |spell| Combined with the highlighting used otherwise. @@ -112,89 +111,88 @@ M.highlights.spell_local = Highlight.new("SpellLocal", { undercurl = true }) ---Word that is recognized by the spellchecker as one that is hardly ever used. |spell| Combined with the highlighting used otherwise. M.highlights.spell_rare = Highlight.new("SpellRare", { undercurl = true }) ---status line of current window -M.highlights.status_line = Highlight.new("StatusLine", { fg = c.default.white, bg = c.default["bg+1"] }) +M.highlights.status_line = Highlight.new("StatusLine", { fg = c.white, bg = c["bg+1"] }) ---status lines of not-current windows Note: if this is equal to "StatusLine" Vim will use "^^^" in the status line of the current window. -M.highlights.status_line_non_current = Highlight.new("StatusLineNC", { fg = c.default.quartz, bg = c.default["bg+1"] }) +M.highlights.status_line_non_current = Highlight.new("StatusLineNC", { fg = c.quartz, bg = c["bg+1"] }) ---tab pages line, not active tab page label -M.highlights.tab_line = Highlight.new("TabLine", { bg = c.default.none }) +M.highlights.tab_line = Highlight.new("TabLine", { bg = c.none }) ---tab pages line, where there are no labels -M.highlights.tab_line_fill = Highlight.new("TabLineFill", { fg = c.default["bg+4"], bg = c.default["bg+1"] }) +M.highlights.tab_line_fill = Highlight.new("TabLineFill", { fg = c["bg+4"], bg = c["bg+1"] }) ---tab pages line, active tab page label -M.highlights.tab_line_sel = - Highlight.new("TabLineSel", { fg = c.default.yellow, bg = c.default.none, bold = opts.bold }) +M.highlights.tab_line_sel = Highlight.new("TabLineSel", { fg = c.yellow, bg = c.none, bold = opts.bold }) ---titles for output from ":set all", ":autocmd" etc. -M.highlights.title = Highlight.new("Title", { fg = c.default.quartz }) +M.highlights.title = Highlight.new("Title", { fg = c.quartz }) ---Visual mode selection -M.highlights.visual = Highlight.new("Visual", { bg = c.default["bg+2"] }) +M.highlights.visual = Highlight.new("Visual", { bg = c["bg+2"] }) ---Visual mode selection when vim is "Not Owning the Selection". -M.highlights.visual_nos = Highlight.new("VisualNOS", { fg = c.default.red }) +M.highlights.visual_nos = Highlight.new("VisualNOS", { fg = c.red }) ---warning messages -M.highlights.warning_msg = Highlight.new("WarningMsg", { fg = c.default.red }) +M.highlights.warning_msg = Highlight.new("WarningMsg", { fg = c.red }) ---"nbsp", "space", "tab" and "trail" in 'listchars' -M.highlights.whitespace = Highlight.new("Whitespace", { fg = c.default["bg+4"], bg = c.default.none }) +M.highlights.whitespace = Highlight.new("Whitespace", { fg = c["bg+4"], bg = c.none }) ---current match in 'wildmenu' completion -M.highlights.wild_menu = Highlight.new("WildMenu", { fg = c.default.black, bg = c.default.yellow }) ----These groups are not listed as default vim groups, +M.highlights.wild_menu = Highlight.new("WildMenu", { fg = c.black, bg = c.yellow }) +---These groups are not listed as vim groups, ---but they are defacto standard group names for syntax highlighting. ---commented out groups should chain up to their "preferred" group by ----default, +--, ---Uncomment and edit if you want more specific syntax highlighting. ---(preferred) any constant -M.highlights.constant = Highlight.new("Constant", { fg = c.default.quartz }) +M.highlights.constant = Highlight.new("Constant", { fg = c.quartz }) --- a string constant: "this is a string" -M.highlights.string = Highlight.new("String", { fg = c.default.green, italic = opts.italic.strings }) +M.highlights.string = Highlight.new("String", { fg = c.green, italic = opts.italic.strings }) --- a character constant: 'c', '\n' -M.highlights.character = Highlight.new("Character", { fg = c.default.green, italic = opts.italic.strings }) +M.highlights.character = Highlight.new("Character", { fg = c.green, italic = opts.italic.strings }) --- a number constant: 234, 0xff -M.highlights.number = Highlight.new("Number", { fg = c.default.fg }) +M.highlights.number = Highlight.new("Number", { fg = c.fg }) --- a boolean constant: TRUE, false -M.highlights.boolean = Highlight.new("Boolean", { fg = c.default.yellow, bold = opts.bold }) +M.highlights.boolean = Highlight.new("Boolean", { fg = c.yellow, bold = opts.bold }) --- a floating point constant: 2.3e10 -M.highlights.float = Highlight.new("Float", { fg = c.default.yellow, bold = opts.bold }) +M.highlights.float = Highlight.new("Float", { fg = c.yellow, bold = opts.bold }) ---(preferred) any variable name -M.highlights.identifier = Highlight.new("Identifier", { fg = c.default["fg+1"] }) +M.highlights.identifier = Highlight.new("Identifier", { fg = c["fg+1"] }) ---function name (also: methods for classes) -M.highlights.func = Highlight.new("Function", { fg = c.default.niagara }) +M.highlights.func = Highlight.new("Function", { fg = c.niagara }) ---(preferred) any statement -M.highlights.statement = Highlight.new("Statement", { fg = c.default.yellow }) +M.highlights.statement = Highlight.new("Statement", { fg = c.yellow }) ---if, then, else, endif, switch, etc. -M.highlights.conditional = Highlight.new("Conditional", { fg = c.default.yellow, bold = opts.bold }) +M.highlights.conditional = Highlight.new("Conditional", { fg = c.yellow, bold = opts.bold }) ---for, do, while, etc. -M.highlights.repeats = Highlight.new("Repeat", { fg = c.default.yellow, bold = opts.bold }) ----case, default, etc. -M.highlights.label = Highlight.new("Label", { fg = c.default.yellow, bold = opts.bold }) +M.highlights.repeats = Highlight.new("Repeat", { fg = c.yellow, bold = opts.bold }) +---case,, etc. +M.highlights.label = Highlight.new("Label", { fg = c.yellow, bold = opts.bold }) ---"sizeof", "+", "*", etc. -M.highlights.operator = Highlight.new("Operator", { fg = c.default.yellow, italic = opts.italic.operators }) +M.highlights.operator = Highlight.new("Operator", { fg = c.yellow, italic = opts.italic.operators }) ---any other keyword -M.highlights.keyword = Highlight.new("Keyword", { fg = c.default.yellow, bold = opts.bold }) +M.highlights.keyword = Highlight.new("Keyword", { fg = c.yellow, bold = opts.bold }) ---try, catch, throw -M.highlights.exception = Highlight.new("Exception", { fg = c.default.yellow, bold = opts.bold }) +M.highlights.exception = Highlight.new("Exception", { fg = c.yellow, bold = opts.bold }) ---(preferred) generic Preprocessor -M.highlights.pre_proc = Highlight.new("PreProc", { fg = c.default.quartz }) +M.highlights.pre_proc = Highlight.new("PreProc", { fg = c.quartz }) ---preprocessor #include -M.highlights.include = Highlight.new("Include", { fg = c.default.quartz }) +M.highlights.include = Highlight.new("Include", { fg = c.quartz }) ---preprocessor #define -M.highlights.define = Highlight.new("Define", { fg = c.default.quartz }) +M.highlights.define = Highlight.new("Define", { fg = c.quartz }) ---same as Define -M.highlights.macro = Highlight.new("Macro", { fg = c.default.quartz }) +M.highlights.macro = Highlight.new("Macro", { fg = c.quartz }) ---preprocessor #if, #else, #endif, etc. -M.highlights.pre_condit = Highlight.new("PreCondit", { fg = c.default.quartz }) +M.highlights.pre_condit = Highlight.new("PreCondit", { fg = c.quartz }) ---(preferred) int, long, char, etc. -M.highlights.type = Highlight.new("Type", { fg = c.default.quartz }) +M.highlights.type = Highlight.new("Type", { fg = c.quartz }) ---static, register, volatile, etc. -M.highlights.storage_class = Highlight.new("StorageClass", { fg = c.default.yellow, bold = opts.bold }) +M.highlights.storage_class = Highlight.new("StorageClass", { fg = c.yellow, bold = opts.bold }) ---struct, union, enum, etc. -M.highlights.structure = Highlight.new("Structure", { fg = c.default.yellow, bold = opts.bold }) +M.highlights.structure = Highlight.new("Structure", { fg = c.yellow, bold = opts.bold }) ---A typedef -M.highlights.typedef = Highlight.new("Typedef", { fg = c.default.yellow, bold = opts.bold }) +M.highlights.typedef = Highlight.new("Typedef", { fg = c.yellow, bold = opts.bold }) ---(preferred) any special symbol -M.highlights.special = Highlight.new("Special", { fg = c.default.yellow }) +M.highlights.special = Highlight.new("Special", { fg = c.yellow }) ---SpecialChar = Highlight.new("", { }) --- special character in a constant ---Tag = Highlight.new("", { }) --- you can use CTRL-] on this ---Delimiter = Highlight.new("", { }) --- character that needs attention ---SpecialComment= { }, ---special things inside a comment ----Debug = Highlight.new("Debug", { fg = c.default["fg+2"] }) --- debugging statements +---Debug = Highlight.new("Debug", { fg = c["fg+2"] }) --- debugging statements ---(preferred) text that stands out, HTML links M.highlights.underlined = Highlight.new("Underlined", { underline = opts.underline }) @@ -206,16 +204,16 @@ M.highlights.italic = Highlight.new("Italic", { italic = true }) ---Error = Highlight.new("Error", { fg = c.error }) ---(preferred) any erroneous construct ---(preferred) anything that needs extra attention; mostly the keywords TODO FIXME and XXX -M.highlights.todo = Highlight.new("Todo", { fg = c.default.bg, bg = c.default.yellow }) -M.highlights.md_heading_delim = Highlight.new("markdownHeadingDelimiter", { fg = c.default.niagara, bold = opts.bold }) -M.highlights.md_code = Highlight.new("markdownCode", { fg = c.default.green }) -M.highlights.md_code_block = Highlight.new("markdownCodeBlock", { fg = c.default.green }) +M.highlights.todo = Highlight.new("Todo", { fg = c.bg, bg = c.yellow }) +M.highlights.md_heading_delim = Highlight.new("markdownHeadingDelimiter", { fg = c.niagara, bold = opts.bold }) +M.highlights.md_code = Highlight.new("markdownCode", { fg = c.green }) +M.highlights.md_code_block = Highlight.new("markdownCodeBlock", { fg = c.green }) ---markdownH1 = Highlight.new("markdownH1", { fg = c.magenta, bold = true }) ---markdownH2 = Highlight.new("markdownH2", { fg = c.blue, bold = true }) ---markdownLinkText = Highlight.new("markdownLinkText", { fg = c.blue, underline = true }) -M.highlights.md_italic = Highlight.new("markdownItalic", { fg = c.default.wisteria, italic = true }) -M.highlights.md_bold = Highlight.new("markdownBold", { fg = c.default.yellow, bold = opts.bold }) -M.highlights.md_code_delim = Highlight.new("markdownCodeDelimiter", { fg = c.default.brown, italic = true }) -M.highlights.md_error = Highlight.new("markdownError", { fg = c.default.fg, bg = c.default["bg+1"] }) +M.highlights.md_italic = Highlight.new("markdownItalic", { fg = c.wisteria, italic = true }) +M.highlights.md_bold = Highlight.new("markdownBold", { fg = c.yellow, bold = opts.bold }) +M.highlights.md_code_delim = Highlight.new("markdownCodeDelimiter", { fg = c.brown, italic = true }) +M.highlights.md_error = Highlight.new("markdownError", { fg = c.fg, bg = c["bg+1"] }) return M