2021-04-17 19:22:55 +00:00
local util = require ( " tokyonight.util " )
2021-04-20 11:39:38 +00:00
local colors = require ( " tokyonight.colors " )
local M = { }
2022-09-05 12:06:03 +00:00
--
---@class Highlight
---@field fg string|nil
---@field bg string|nil
---@field sp string|nil
---@field style string|nil
2021-04-20 11:39:38 +00:00
2022-09-05 12:06:03 +00:00
---@alias Highlights table<string,Highlight>
2021-04-20 11:39:38 +00:00
2022-09-05 12:06:03 +00:00
---@return Theme
function M . setup ( )
2022-09-10 07:35:41 +00:00
local config = require ( " tokyonight.config " )
local options = config.options
2021-04-20 11:39:38 +00:00
---@class Theme
2022-09-05 18:32:31 +00:00
---@field highlights Highlights
2022-09-05 12:06:03 +00:00
local theme = {
2022-09-10 07:35:41 +00:00
config = options ,
2022-09-05 12:06:03 +00:00
colors = colors.setup ( ) ,
}
2022-09-03 21:47:25 +00:00
2021-04-20 11:39:38 +00:00
local c = theme.colors
2022-09-05 18:32:31 +00:00
theme.highlights = {
Foo = { bg = c.magenta2 , fg = c.magenta2 } ,
2022-09-10 07:35:41 +00:00
Comment = { fg = c.comment , style = options.styles . comments } , -- any comment
2021-08-05 07:59:48 +00:00
ColorColumn = { bg = c.black } , -- used for the columns set with 'colorcolumn'
2021-08-06 08:18:04 +00:00
Conceal = { fg = c.dark5 } , -- placeholder characters substituted for concealed text (see 'conceallevel')
2021-04-25 09:42:59 +00:00
Cursor = { fg = c.bg , bg = c.fg } , -- character under the cursor
lCursor = { fg = c.bg , bg = c.fg } , -- the character under the cursor when |language-mapping| is used (see 'guicursor')
CursorIM = { fg = c.bg , bg = c.fg } , -- like Cursor, but used when in IME mode |CursorIM|
2021-04-20 11:39:38 +00:00
CursorColumn = { bg = c.bg_highlight } , -- Screen-column at the cursor, when 'cursorcolumn' is set.
CursorLine = { bg = c.bg_highlight } , -- Screen-line at the cursor, when 'cursorline' is set. Low-priority if foreground (ctermfg OR guifg) is not set.
2021-04-20 23:04:52 +00:00
Directory = { fg = c.blue } , -- directory names (and other special names in listings)
2021-04-20 11:39:38 +00:00
DiffAdd = { bg = c.diff . add } , -- diff mode: Added line |diff.txt|
DiffChange = { bg = c.diff . change } , -- diff mode: Changed line |diff.txt|
DiffDelete = { bg = c.diff . delete } , -- diff mode: Deleted line |diff.txt|
2021-05-02 07:40:40 +00:00
DiffText = { bg = c.diff . text } , -- diff mode: Changed text within a changed line |diff.txt|
2021-04-20 11:39:38 +00:00
EndOfBuffer = { fg = c.bg } , -- filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|.
-- TermCursor = { }, -- cursor in a focused terminal
-- TermCursorNC= { }, -- cursor in an unfocused terminal
ErrorMsg = { fg = c.error } , -- error messages on the command line
VertSplit = { fg = c.border } , -- the column separating vertically split windows
2022-09-12 05:51:08 +00:00
WinSeparator = { fg = c.border , bold = true } , -- the column separating vertically split windows
2021-04-20 11:39:38 +00:00
Folded = { fg = c.blue , bg = c.fg_gutter } , -- line used for closed folds
FoldColumn = { bg = c.bg , fg = c.comment } , -- 'foldcolumn'
2022-09-10 07:35:41 +00:00
SignColumn = { bg = options.transparent and c.none or c.bg , fg = c.fg_gutter } , -- column where |signs| are displayed
2021-04-20 11:39:38 +00:00
SignColumnSB = { bg = c.bg_sidebar , fg = c.fg_gutter } , -- column where |signs| are displayed
2021-04-28 20:07:19 +00:00
Substitute = { bg = c.red , fg = c.black } , -- |:substitute| replacement text highlighting
2021-04-20 11:39:38 +00:00
LineNr = { fg = c.fg_gutter } , -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set.
CursorLineNr = { fg = c.dark5 } , -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line.
2022-09-12 05:51:08 +00:00
MatchParen = { fg = c.orange , bold = true } , -- The character under the cursor or just before it, if it is a paired bracket, and its match. |pi_paren.txt|
ModeMsg = { fg = c.fg_dark , bold = true } , -- 'showmode' message (e.g., "-- INSERT -- ")
2022-09-11 14:14:14 +00:00
MsgArea = { fg = c.fg_dark , bg = c.bg_sidebar } , -- Area for messages and cmdline
2021-04-20 11:39:38 +00:00
-- MsgSeparator= { }, -- Separator for scrolled messages, `msgsep` flag of 'display'
MoreMsg = { fg = c.blue } , -- |more-prompt|
NonText = { fg = c.dark3 } , -- '@' 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|.
2022-09-10 07:35:41 +00:00
Normal = { fg = c.fg , bg = options.transparent and c.none or c.bg } , -- normal text
NormalNC = { fg = c.fg , bg = options.transparent and c.none or options.dim_inactive and c.bg_dark or c.bg } , -- normal text in non-current windows
2022-09-02 05:57:12 +00:00
NormalSB = { fg = c.fg_sidebar , bg = c.bg_sidebar } , -- normal text in sidebar
2021-04-20 11:39:38 +00:00
NormalFloat = { fg = c.fg , bg = c.bg_float } , -- Normal text in floating windows.
2021-11-30 08:07:38 +00:00
FloatBorder = { fg = c.border_highlight , bg = c.bg_float } ,
2021-04-20 18:49:14 +00:00
Pmenu = { bg = c.bg_popup , fg = c.fg } , -- Popup menu: normal item.
2021-04-20 11:39:38 +00:00
PmenuSel = { bg = util.darken ( c.fg_gutter , 0.8 ) } , -- Popup menu: selected item.
PmenuSbar = { bg = util.lighten ( c.bg_popup , 0.95 ) } , -- Popup menu: scrollbar.
PmenuThumb = { bg = c.fg_gutter } , -- Popup menu: Thumb of the scrollbar.
Question = { fg = c.blue } , -- |hit-enter| prompt and yes/no questions
2022-09-12 05:51:08 +00:00
QuickFixLine = { bg = c.bg_visual , bold = true } , -- Current |quickfix| item in the quickfix window. Combined with |hl-CursorLine| when the cursor is there.
2021-04-20 11:39:38 +00:00
Search = { bg = c.bg_search , fg = c.fg } , -- Last search pattern highlighting (see 'hlsearch'). Also used for similar items that need to stand out.
2021-04-26 05:28:33 +00:00
IncSearch = { bg = c.orange , fg = c.black } , -- 'incsearch' highlighting; also used for the text replaced with ":s///c"
2021-04-20 11:39:38 +00:00
SpecialKey = { fg = c.dark3 } , -- Unprintable characters: text displayed differently from what it really is. But not 'listchars' whitespace. |hl-Whitespace|
2022-09-12 05:51:08 +00:00
SpellBad = { sp = c.error , undercurl = true } , -- Word that is not recognized by the spellchecker. |spell| Combined with the highlighting used otherwise.
SpellCap = { sp = c.warning , undercurl = true } , -- Word that should start with a capital. |spell| Combined with the highlighting used otherwise.
SpellLocal = { sp = c.info , undercurl = true } , -- Word that is recognized by the spellchecker as one that is used in another region. |spell| Combined with the highlighting used otherwise.
SpellRare = { sp = c.hint , undercurl = true } , -- Word that is recognized by the spellchecker as one that is hardly ever used. |spell| Combined with the highlighting used otherwise.
2021-04-20 11:39:38 +00:00
StatusLine = { fg = c.fg_sidebar , bg = c.bg_statusline } , -- status line of current window
2021-04-23 07:17:28 +00:00
StatusLineNC = { fg = c.fg_gutter , bg = c.bg_statusline } , -- status lines of not-current windows Note: if this is equal to "StatusLine" Vim will use "^^^" in the status line of the current window.
2021-04-20 11:39:38 +00:00
TabLine = { bg = c.bg_statusline , fg = c.fg_gutter } , -- tab pages line, not active tab page label
2021-04-21 06:04:57 +00:00
TabLineFill = { bg = c.black } , -- tab pages line, where there are no labels
TabLineSel = { fg = c.black , bg = c.blue } , -- tab pages line, active tab page label
2022-09-12 05:51:08 +00:00
Title = { fg = c.blue , bold = true } , -- titles for output from ":set all", ":autocmd" etc.
2021-04-20 11:39:38 +00:00
Visual = { bg = c.bg_visual } , -- Visual mode selection
VisualNOS = { bg = c.bg_visual } , -- Visual mode selection when vim is "Not Owning the Selection".
WarningMsg = { fg = c.warning } , -- warning messages
Whitespace = { fg = c.fg_gutter } , -- "nbsp", "space", "tab" and "trail" in 'listchars'
WildMenu = { bg = c.bg_visual } , -- 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
-- default,
-- Uncomment and edit if you want more specific syntax highlighting.
Constant = { fg = c.orange } , -- (preferred) any constant
String = { fg = c.green } , -- a string constant: "this is a string"
Character = { fg = c.green } , -- a character constant: 'c', '\n'
-- Number = { }, -- a number constant: 234, 0xff
-- Boolean = { }, -- a boolean constant: TRUE, false
-- Float = { }, -- a floating point constant: 2.3e10
2022-09-10 07:35:41 +00:00
Identifier = { fg = c.magenta , style = options.styles . variables } , -- (preferred) any variable name
Function = { fg = c.blue , style = options.styles . functions } , -- function name (also: methods for classes)
2021-04-20 11:39:38 +00:00
Statement = { fg = c.magenta } , -- (preferred) any statement
-- Conditional = { }, -- if, then, else, endif, switch, etc.
-- Repeat = { }, -- for, do, while, etc.
-- Label = { }, -- case, default, etc.
Operator = { fg = c.blue5 } , -- "sizeof", "+", "*", etc.
2022-09-10 07:35:41 +00:00
Keyword = { fg = c.cyan , style = options.styles . keywords } , -- any other keyword
2021-04-20 11:39:38 +00:00
-- Exception = { }, -- try, catch, throw
PreProc = { fg = c.cyan } , -- (preferred) generic Preprocessor
-- Include = { }, -- preprocessor #include
-- Define = { }, -- preprocessor #define
-- Macro = { }, -- same as Define
-- PreCondit = { }, -- preprocessor #if, #else, #endif, etc.
Type = { fg = c.blue1 } , -- (preferred) int, long, char, etc.
-- StorageClass = { }, -- static, register, volatile, etc.
-- Structure = { }, -- struct, union, enum, etc.
-- Typedef = { }, -- A typedef
Special = { fg = c.blue1 } , -- (preferred) any special symbol
-- SpecialChar = { }, -- special character in a constant
-- Tag = { }, -- you can use CTRL-] on this
-- Delimiter = { }, -- character that needs attention
-- SpecialComment= { }, -- special things inside a comment
-- Debug = { }, -- debugging statements
2022-09-12 05:51:08 +00:00
Underlined = { underline = true } , -- (preferred) text that stands out, HTML links
Bold = { bold = true } ,
Italic = { italic = true } ,
2021-04-20 11:39:38 +00:00
-- ("Ignore", below, may be invisible...)
2021-04-23 07:17:28 +00:00
-- Ignore = { }, -- (preferred) left blank, hidden |hl-Ignore|
2021-04-20 11:39:38 +00:00
Error = { fg = c.error } , -- (preferred) any erroneous construct
Todo = { bg = c.yellow , fg = c.bg } , -- (preferred) anything that needs extra attention; mostly the keywords TODO FIXME and XXX
qfLineNr = { fg = c.dark5 } ,
qfFileName = { fg = c.blue } ,
2022-09-12 05:51:08 +00:00
htmlH1 = { fg = c.magenta , bold = true } ,
htmlH2 = { fg = c.blue , bold = true } ,
2021-05-11 11:21:48 +00:00
2022-09-12 05:51:08 +00:00
-- mkdHeading = { fg = c.orange, bold = true },
2021-05-21 10:19:26 +00:00
-- mkdCode = { bg = c.terminal_black, fg = c.fg },
2021-05-11 11:21:48 +00:00
mkdCodeDelimiter = { bg = c.terminal_black , fg = c.fg } ,
2022-09-12 05:51:08 +00:00
mkdCodeStart = { fg = c.teal , bold = true } ,
mkdCodeEnd = { fg = c.teal , bold = true } ,
-- mkdLink = { fg = c.blue, underline = true },
2021-05-21 10:19:26 +00:00
2022-09-12 05:51:08 +00:00
markdownHeadingDelimiter = { fg = c.orange , bold = true } ,
2021-05-21 10:19:26 +00:00
markdownCode = { fg = c.teal } ,
markdownCodeBlock = { fg = c.teal } ,
2022-09-12 05:51:08 +00:00
markdownH1 = { fg = c.magenta , bold = true } ,
markdownH2 = { fg = c.blue , bold = true } ,
markdownLinkText = { fg = c.blue , underline = true } ,
2021-04-20 11:39:38 +00:00
2022-09-12 05:51:08 +00:00
[ " @punctuation.special.markdown " ] = { fg = c.orange , bold = true } ,
2022-09-10 17:57:29 +00:00
[ " @text.literal.markdown_inline " ] = { bg = c.terminal_black , fg = c.blue } ,
2021-05-05 10:27:44 +00:00
debugPC = { bg = c.bg_sidebar } , -- used for highlighting the current line in terminal-debug
debugBreakpoint = { bg = util.darken ( c.info , 0.1 ) , fg = c.info } , -- used for breakpoint colors in terminal-debug
2021-04-20 11:39:38 +00:00
-- These groups are for the native LSP client. Some other LSP clients may
-- use these groups, or use their own. Consult your LSP client's
-- documentation.
LspReferenceText = { bg = c.fg_gutter } , -- used for highlighting "text" references
LspReferenceRead = { bg = c.fg_gutter } , -- used for highlighting "read" references
LspReferenceWrite = { bg = c.fg_gutter } , -- used for highlighting "write" references
2021-10-21 08:11:39 +00:00
DiagnosticError = { fg = c.error } , -- Used as the base highlight group. Other Diagnostic highlights link to this by default
DiagnosticWarn = { fg = c.warning } , -- Used as the base highlight group. Other Diagnostic highlights link to this by default
DiagnosticInfo = { fg = c.info } , -- Used as the base highlight group. Other Diagnostic highlights link to this by default
DiagnosticHint = { fg = c.hint } , -- Used as the base highlight group. Other Diagnostic highlights link to this by default
2021-10-21 08:25:26 +00:00
DiagnosticVirtualTextError = { bg = util.darken ( c.error , 0.1 ) , fg = c.error } , -- Used for "Error" diagnostic virtual text
DiagnosticVirtualTextWarn = { bg = util.darken ( c.warning , 0.1 ) , fg = c.warning } , -- Used for "Warning" diagnostic virtual text
DiagnosticVirtualTextInfo = { bg = util.darken ( c.info , 0.1 ) , fg = c.info } , -- Used for "Information" diagnostic virtual text
DiagnosticVirtualTextHint = { bg = util.darken ( c.hint , 0.1 ) , fg = c.hint } , -- Used for "Hint" diagnostic virtual text
2022-09-12 05:51:08 +00:00
DiagnosticUnderlineError = { undercurl = true , sp = c.error } , -- Used to underline "Error" diagnostics
DiagnosticUnderlineWarn = { undercurl = true , sp = c.warning } , -- Used to underline "Warning" diagnostics
DiagnosticUnderlineInfo = { undercurl = true , sp = c.info } , -- Used to underline "Information" diagnostics
DiagnosticUnderlineHint = { undercurl = true , sp = c.hint } , -- Used to underline "Hint" diagnostics
2021-10-21 08:25:26 +00:00
2021-07-08 08:26:49 +00:00
LspSignatureActiveParameter = { fg = c.orange } ,
2021-08-05 07:25:57 +00:00
LspCodeLens = { fg = c.comment } ,
2021-07-08 08:26:49 +00:00
2021-08-05 07:34:39 +00:00
ALEErrorSign = { fg = c.error } ,
ALEWarningSign = { fg = c.warning } ,
2021-04-20 11:39:38 +00:00
-- 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,
-- TSError -> Error for example, so you do not have to define these unless
-- you explicitly want to support Treesitter's improved syntax awareness.
-- TSAnnotation = { }; -- For C++/Dart attributes, annotations that can be attached to the code to denote some kind of meta information.
-- TSAttribute = { }; -- (unstable) TODO: docs
-- TSBoolean = { }; -- For booleans.
-- TSCharacter = { }; -- For characters.
-- TSComment = { }; -- For comment blocks.
2021-05-17 06:44:57 +00:00
TSNote = { fg = c.bg , bg = c.info } ,
TSWarning = { fg = c.bg , bg = c.warning } ,
TSDanger = { fg = c.bg , bg = c.error } ,
2021-04-20 11:39:38 +00:00
TSConstructor = { fg = c.magenta } , -- For constructor calls and definitions: `= { }` in Lua, and Java constructors.
-- TSConditional = { }; -- For keywords related to conditionnals.
-- TSConstant = { }; -- For constants
-- TSConstBuiltin = { }; -- For constant that are built in the language: `nil` in Lua.
-- TSConstMacro = { }; -- For constants that are defined by macros: `NULL` in C.
-- TSError = { }; -- For syntax/parser errors.
-- TSException = { }; -- For exception related keywords.
TSField = { fg = c.green1 } , -- For fields.
-- TSFloat = { }; -- For floats.
-- TSFunction = { }; -- For function (calls and definitions).
-- TSFuncBuiltin = { }; -- For builtin functions: `table.insert` in Lua.
-- TSFuncMacro = { }; -- For macro defined fuctions (calls and definitions): each `macro_rules` in Rust.
-- TSInclude = { }; -- For includes: `#include` in C, `use` or `extern crate` in Rust, or `require` in Lua.
2022-09-10 07:35:41 +00:00
TSKeyword = { fg = c.purple , style = options.styles . keywords } , -- For keywords that don't fall in previous categories.
TSKeywordFunction = { fg = c.magenta , style = options.styles . functions } , -- For keywords used to define a fuction.
2021-04-20 11:39:38 +00:00
TSLabel = { fg = c.blue } , -- For labels: `label:` in C and `:label:` in Lua.
-- TSMethod = { }; -- For method calls and definitions.
-- TSNamespace = { }; -- For identifiers referring to modules and namespaces.
-- TSNone = { }; -- TODO: docs
-- TSNumber = { }; -- For all numbers
TSOperator = { fg = c.blue5 } , -- For any operator: `+`, but also `->` and `*` in C.
TSParameter = { fg = c.yellow } , -- For parameters of a function.
-- TSParameterReference= { }; -- For references to parameters of a function.
TSProperty = { fg = c.green1 } , -- Same as `TSField`.
TSPunctDelimiter = { fg = c.blue5 } , -- For delimiters ie: `.`
TSPunctBracket = { fg = c.fg_dark } , -- For brackets and parens.
TSPunctSpecial = { fg = c.blue5 } , -- For special punctutation that does not fall in the catagories before.
-- TSRepeat = { }; -- For keywords related to loops.
-- TSString = { }; -- For strings.
TSStringRegex = { fg = c.blue6 } , -- For regexes.
TSStringEscape = { fg = c.magenta } , -- For escape characters within a string.
-- TSSymbol = { }; -- For identifiers referring to symbols or atoms.
-- TSType = { }; -- For types.
-- TSTypeBuiltin = { }; -- For builtin types.
2022-09-10 07:35:41 +00:00
TSVariable = { style = options.styles . variables } , -- Any variable name that does not have another highlight.
2021-04-20 11:39:38 +00:00
TSVariableBuiltin = { fg = c.red } , -- Variable names that are defined by the languages, like `this` or `self`.
-- TSTag = { }; -- Tags like html tag names.
-- TSTagDelimiter = { }; -- Tag delimiter like `<` `>` `/`
-- TSText = { }; -- For strings considered text in a markup language.
2021-06-17 11:43:36 +00:00
TSTextReference = { fg = c.teal } ,
2021-04-20 11:39:38 +00:00
-- TSEmphasis = { }; -- For text to be represented with emphasis.
-- TSUnderline = { }; -- For text to be represented with an underline.
-- TSStrike = { }; -- For strikethrough text.
-- TSTitle = { }; -- Text that is part of a title.
-- TSLiteral = { }; -- Literal text.
-- TSURI = { }; -- Any URI like a link or email.
2021-04-21 08:03:43 +00:00
-- Lua
-- luaTSProperty = { fg = c.red }, -- Same as `TSField`.
2022-09-02 06:08:07 +00:00
-- ts-rainbow
rainbowcol1 = { fg = c.dark3 } ,
rainbowcol2 = { fg = c.yellow } ,
rainbowcol3 = { fg = c.blue2 } ,
rainbowcol4 = { fg = c.orange } ,
rainbowcol5 = { fg = c.purple } ,
rainbowcol6 = { fg = c.green1 } ,
rainbowcol7 = { fg = c.red } ,
2022-09-03 13:44:00 +00:00
2021-04-21 21:48:55 +00:00
-- LspTrouble
2022-09-05 18:32:31 +00:00
TroubleText = { fg = c.fg_dark } ,
TroubleCount = { fg = c.magenta , bg = c.fg_gutter } ,
TroubleNormal = { fg = c.fg_sidebar , bg = c.bg_sidebar } ,
2021-04-21 21:48:55 +00:00
2021-05-01 11:52:43 +00:00
-- Illuminate
illuminatedWord = { bg = c.fg_gutter } ,
illuminatedCurWord = { bg = c.fg_gutter } ,
2022-09-01 10:28:04 +00:00
IlluminatedWordText = { bg = c.fg_gutter } ,
IlluminatedWordRead = { bg = c.fg_gutter } ,
IlluminatedWordWrite = { bg = c.fg_gutter } ,
2021-05-01 11:52:43 +00:00
2021-04-21 06:21:31 +00:00
-- diff
diffAdded = { fg = c.git . add } ,
diffRemoved = { fg = c.git . delete } ,
diffChanged = { fg = c.git . change } ,
diffOldFile = { fg = c.yellow } ,
diffNewFile = { fg = c.orange } ,
diffFile = { fg = c.blue } ,
diffLine = { fg = c.comment } ,
diffIndexLine = { fg = c.magenta } ,
2021-04-21 07:06:52 +00:00
-- Neogit
NeogitBranch = { fg = c.magenta } ,
NeogitRemote = { fg = c.purple } ,
NeogitHunkHeader = { bg = c.bg_highlight , fg = c.fg } ,
NeogitHunkHeaderHighlight = { bg = c.fg_gutter , fg = c.blue } ,
2021-05-12 09:18:48 +00:00
NeogitDiffContextHighlight = { bg = util.darken ( c.fg_gutter , 0.5 ) , fg = c.fg_dark } ,
2021-04-21 07:06:52 +00:00
NeogitDiffDeleteHighlight = { fg = c.git . delete , bg = c.diff . delete } ,
NeogitDiffAddHighlight = { fg = c.git . add , bg = c.diff . add } ,
2021-04-20 11:39:38 +00:00
-- GitGutter
2021-04-25 09:42:59 +00:00
GitGutterAdd = { fg = c.gitSigns . add } , -- diff mode: Added line |diff.txt|
GitGutterChange = { fg = c.gitSigns . change } , -- diff mode: Changed line |diff.txt|
GitGutterDelete = { fg = c.gitSigns . delete } , -- diff mode: Deleted line |diff.txt|
2021-04-20 11:39:38 +00:00
-- GitSigns
2021-04-25 09:42:59 +00:00
GitSignsAdd = { fg = c.gitSigns . add } , -- diff mode: Added line |diff.txt|
GitSignsChange = { fg = c.gitSigns . change } , -- diff mode: Changed line |diff.txt|
GitSignsDelete = { fg = c.gitSigns . delete } , -- diff mode: Deleted line |diff.txt|
2021-04-20 11:39:38 +00:00
-- Telescope
2022-09-05 18:32:31 +00:00
TelescopeBorder = { fg = c.border_highlight , bg = c.bg_float } ,
TelescopeNormal = { fg = c.fg , bg = c.bg_float } ,
2021-04-20 11:39:38 +00:00
-- NvimTree
NvimTreeNormal = { fg = c.fg_sidebar , bg = c.bg_sidebar } ,
2021-10-21 10:27:46 +00:00
NvimTreeNormalNC = { fg = c.fg_sidebar , bg = c.bg_sidebar } ,
2022-09-12 05:51:08 +00:00
NvimTreeRootFolder = { fg = c.blue , bold = true } ,
2021-04-20 11:39:38 +00:00
NvimTreeGitDirty = { fg = c.git . change } ,
NvimTreeGitNew = { fg = c.git . add } ,
2021-05-02 08:13:28 +00:00
NvimTreeGitDeleted = { fg = c.git . delete } ,
2022-09-03 13:44:00 +00:00
NvimTreeOpenedFile = { bg = c.bg_highlight } ,
2022-09-12 05:51:08 +00:00
NvimTreeSpecialFile = { fg = c.purple , underline = true } ,
2021-05-07 09:43:49 +00:00
NvimTreeIndentMarker = { fg = c.fg_gutter } ,
2021-05-11 11:21:48 +00:00
NvimTreeImageFile = { fg = c.fg_sidebar } ,
NvimTreeSymlink = { fg = c.blue } ,
2022-09-02 05:59:08 +00:00
NvimTreeFolderIcon = { bg = c.none , fg = c.yellow } ,
2021-04-20 11:39:38 +00:00
-- NvimTreeFolderName= { fg = c.fg_float },
2022-09-10 19:16:35 +00:00
NeoTreeNormal = { fg = c.fg_sidebar , bg = c.bg_sidebar } ,
NeoTreeNormalNC = { fg = c.fg_sidebar , bg = c.bg_sidebar } ,
2022-09-10 19:17:21 +00:00
2021-06-25 15:09:43 +00:00
-- Fern
FernBranchText = { fg = c.blue } ,
2021-06-24 07:20:09 +00:00
2021-06-25 15:09:43 +00:00
-- glyph palette
GlyphPalette1 = { fg = c.red1 } ,
GlyphPalette2 = { fg = c.green } ,
GlyphPalette3 = { fg = c.yellow } ,
GlyphPalette4 = { fg = c.blue } ,
GlyphPalette6 = { fg = c.green1 } ,
GlyphPalette7 = { fg = c.fg } ,
GlyphPalette9 = { fg = c.red } ,
2021-06-24 07:20:09 +00:00
2021-04-20 11:39:38 +00:00
-- Dashboard
DashboardShortCut = { fg = c.cyan } ,
DashboardHeader = { fg = c.blue } ,
DashboardCenter = { fg = c.magenta } ,
2022-09-12 05:51:08 +00:00
DashboardFooter = { fg = c.yellow , italic = true } ,
2021-04-20 11:39:38 +00:00
-- WhichKey
WhichKey = { fg = c.cyan } ,
WhichKeyGroup = { fg = c.blue } ,
WhichKeyDesc = { fg = c.magenta } ,
WhichKeySeperator = { fg = c.comment } ,
2021-04-28 12:59:44 +00:00
WhichKeySeparator = { fg = c.comment } ,
2021-05-04 06:27:18 +00:00
WhichKeyFloat = { bg = c.bg_sidebar } ,
2021-05-01 11:52:43 +00:00
WhichKeyValue = { fg = c.dark5 } ,
2021-04-20 11:39:38 +00:00
-- LspSaga
2021-10-21 08:25:26 +00:00
DiagnosticWarning = { link = " DiagnosticWarn " } ,
DiagnosticInformation = { link = " DiagnosticInfo " } ,
2021-06-25 15:09:43 +00:00
2021-07-20 07:40:31 +00:00
LspFloatWinNormal = { bg = c.bg_float } ,
2021-06-25 15:09:43 +00:00
LspFloatWinBorder = { fg = c.border_highlight } ,
LspSagaBorderTitle = { fg = c.cyan } ,
LspSagaHoverBorder = { fg = c.blue } ,
LspSagaRenameBorder = { fg = c.green } ,
LspSagaDefPreviewBorder = { fg = c.green } ,
LspSagaCodeActionBorder = { fg = c.blue } ,
LspSagaFinderSelection = { fg = c.bg_visual } ,
LspSagaCodeActionTitle = { fg = c.blue1 } ,
LspSagaCodeActionContent = { fg = c.purple } ,
LspSagaSignatureHelpBorder = { fg = c.red } ,
ReferencesCount = { fg = c.purple } ,
DefinitionCount = { fg = c.purple } ,
DefinitionIcon = { fg = c.blue } ,
ReferencesIcon = { fg = c.blue } ,
TargetWord = { fg = c.cyan } ,
2021-04-20 11:39:38 +00:00
-- NeoVim
healthError = { fg = c.error } ,
healthSuccess = { fg = c.green1 } ,
healthWarning = { fg = c.warning } ,
-- BufferLine
BufferLineIndicatorSelected = { fg = c.git . change } ,
2021-07-20 07:41:49 +00:00
-- Barbar
BufferCurrent = { bg = c.fg_gutter , fg = c.fg } ,
BufferCurrentIndex = { bg = c.fg_gutter , fg = c.info } ,
BufferCurrentMod = { bg = c.fg_gutter , fg = c.warning } ,
BufferCurrentSign = { bg = c.fg_gutter , fg = c.info } ,
BufferCurrentTarget = { bg = c.fg_gutter , fg = c.red } ,
BufferVisible = { bg = c.bg_statusline , fg = c.fg } ,
BufferVisibleIndex = { bg = c.bg_statusline , fg = c.info } ,
BufferVisibleMod = { bg = c.bg_statusline , fg = c.warning } ,
BufferVisibleSign = { bg = c.bg_statusline , fg = c.info } ,
BufferVisibleTarget = { bg = c.bg_statusline , fg = c.red } ,
BufferInactive = { bg = c.bg_statusline , fg = c.dark5 } ,
BufferInactiveIndex = { bg = c.bg_statusline , fg = c.dark5 } ,
BufferInactiveMod = { bg = c.bg_statusline , fg = util.darken ( c.warning , 0.7 ) } ,
BufferInactiveSign = { bg = c.bg_statusline , fg = c.border_highlight } ,
BufferInactiveTarget = { bg = c.bg_statusline , fg = c.red } ,
BufferTabpages = { bg = c.bg_statusline , fg = c.none } ,
BufferTabpage = { bg = c.bg_statusline , fg = c.border_highlight } ,
2021-04-21 21:48:06 +00:00
-- Sneak
Sneak = { fg = c.bg_highlight , bg = c.magenta } ,
2021-04-21 21:56:40 +00:00
SneakScope = { bg = c.bg_visual } ,
2021-04-21 22:09:25 +00:00
-- Hop
2022-09-12 05:51:08 +00:00
HopNextKey = { fg = c.magenta2 , bold = true } ,
HopNextKey1 = { fg = c.blue2 , bold = true } ,
2021-07-09 21:35:04 +00:00
HopNextKey2 = { fg = util.darken ( c.blue2 , 0.3 ) } ,
2021-04-21 22:09:25 +00:00
HopUnmatched = { fg = c.dark3 } ,
2021-07-09 21:35:04 +00:00
2022-09-12 05:51:08 +00:00
LeapMatch = { bg = c.magenta2 , fg = c.fg , bold = true } ,
LeapLabelPrimary = { fg = c.magenta2 , bold = true } ,
LeapLabelSecondary = { fg = c.green1 , bold = true } ,
2022-09-05 21:47:57 +00:00
LeapBackdrop = { fg = c.dark3 } ,
2021-07-09 21:35:04 +00:00
LightspeedGreyWash = { fg = c.dark3 } ,
2021-12-17 22:30:40 +00:00
-- LightspeedCursor = { link = "Cursor" },
2022-09-12 05:51:08 +00:00
LightspeedLabel = { fg = c.magenta2 , bold = true , underline = true } ,
LightspeedLabelDistant = { fg = c.green1 , bold = true , underline = true } ,
LightspeedLabelDistantOverlapped = { fg = c.green2 , underline = true } ,
LightspeedLabelOverlapped = { fg = c.magenta2 , underline = true } ,
2021-12-17 22:30:40 +00:00
LightspeedMaskedChar = { fg = c.orange } ,
2022-09-12 05:51:08 +00:00
LightspeedOneCharMatch = { bg = c.magenta2 , fg = c.fg , bold = true } ,
2021-12-17 22:30:40 +00:00
LightspeedPendingOpArea = { bg = c.magenta2 , fg = c.fg } ,
2022-09-12 05:51:08 +00:00
LightspeedShortcut = { bg = c.magenta2 , fg = c.fg , bold = true , underline = true } ,
2021-12-17 22:30:40 +00:00
-- LightspeedShortcutOverlapped = { link = "LightspeedShortcut" },
-- LightspeedUniqueChar = { link = "LightspeedUnlabeledMatch" },
2022-09-12 05:51:08 +00:00
LightspeedUnlabeledMatch = { fg = c.blue2 , bold = true } ,
2021-10-21 08:11:39 +00:00
-- Cmp
CmpDocumentation = { fg = c.fg , bg = c.bg_float } ,
CmpDocumentationBorder = { fg = c.border_highlight , bg = c.bg_float } ,
2021-11-30 08:06:50 +00:00
2021-10-21 08:11:39 +00:00
CmpItemAbbr = { fg = c.fg , bg = c.none } ,
2022-09-12 05:51:08 +00:00
CmpItemAbbrDeprecated = { fg = c.fg_gutter , bg = c.none , strikethrough = true } ,
2021-11-30 08:06:50 +00:00
CmpItemAbbrMatch = { fg = c.blue1 , bg = c.none } ,
CmpItemAbbrMatchFuzzy = { fg = c.blue1 , bg = c.none } ,
CmpItemKindDefault = { fg = c.fg_dark , bg = c.none } ,
2021-10-21 08:11:39 +00:00
CmpItemMenu = { fg = c.comment , bg = c.none } ,
2021-12-17 22:30:40 +00:00
2021-12-04 13:14:58 +00:00
CmpItemKindKeyword = { fg = c.cyan , bg = c.none } ,
2021-11-30 08:06:50 +00:00
CmpItemKindVariable = { fg = c.magenta , bg = c.none } ,
2021-12-04 13:14:58 +00:00
CmpItemKindConstant = { fg = c.magenta , bg = c.none } ,
CmpItemKindReference = { fg = c.magenta , bg = c.none } ,
CmpItemKindValue = { fg = c.magenta , bg = c.none } ,
2021-11-30 08:06:50 +00:00
CmpItemKindFunction = { fg = c.blue , bg = c.none } ,
CmpItemKindMethod = { fg = c.blue , bg = c.none } ,
2021-12-04 13:14:58 +00:00
CmpItemKindConstructor = { fg = c.blue , bg = c.none } ,
2021-11-30 08:06:50 +00:00
CmpItemKindClass = { fg = c.orange , bg = c.none } ,
CmpItemKindInterface = { fg = c.orange , bg = c.none } ,
2021-12-04 13:14:58 +00:00
CmpItemKindStruct = { fg = c.orange , bg = c.none } ,
CmpItemKindEvent = { fg = c.orange , bg = c.none } ,
CmpItemKindEnum = { fg = c.orange , bg = c.none } ,
CmpItemKindUnit = { fg = c.orange , bg = c.none } ,
2021-12-17 22:30:40 +00:00
2021-12-04 13:14:58 +00:00
CmpItemKindModule = { fg = c.yellow , bg = c.none } ,
2021-11-30 08:06:50 +00:00
CmpItemKindProperty = { fg = c.green1 , bg = c.none } ,
CmpItemKindField = { fg = c.green1 , bg = c.none } ,
2021-12-04 13:14:58 +00:00
CmpItemKindTypeParameter = { fg = c.green1 , bg = c.none } ,
CmpItemKindEnumMember = { fg = c.green1 , bg = c.none } ,
CmpItemKindOperator = { fg = c.green1 , bg = c.none } ,
2021-11-30 08:06:50 +00:00
CmpItemKindSnippet = { fg = c.dark5 , bg = c.none } ,
2022-09-02 05:54:15 +00:00
2022-09-05 20:43:35 +00:00
IndentBlanklineChar = { fg = c.fg_gutter } ,
IndentBlanklineContextChar = { fg = c.purple } ,
2022-09-02 06:12:22 +00:00
-- Scrollbar
2022-09-03 13:44:00 +00:00
ScrollbarHandle = { fg = c.none , bg = c.bg_highlight } ,
2022-09-02 06:12:22 +00:00
2022-09-03 13:44:00 +00:00
ScrollbarSearchHandle = { fg = c.orange , bg = c.bg_highlight } ,
ScrollbarSearch = { fg = c.orange , bg = c.none } ,
2022-09-02 06:12:22 +00:00
2022-09-03 13:44:00 +00:00
ScrollbarErrorHandle = { fg = c.error , bg = c.bg_highlight } ,
ScrollbarError = { fg = c.error , bg = c.none } ,
2022-09-02 06:12:22 +00:00
2022-09-03 13:44:00 +00:00
ScrollbarWarnHandle = { fg = c.warning , bg = c.bg_highlight } ,
ScrollbarWarn = { fg = c.warning , bg = c.none } ,
2022-09-02 06:12:22 +00:00
2022-09-03 13:44:00 +00:00
ScrollbarInfoHandle = { fg = c.info , bg = c.bg_highlight } ,
ScrollbarInfo = { fg = c.info , bg = c.none } ,
2022-09-02 06:12:22 +00:00
2022-09-03 13:44:00 +00:00
ScrollbarHintHandle = { fg = c.hint , bg = c.bg_highlight } ,
ScrollbarHint = { fg = c.hint , bg = c.none } ,
2022-09-02 06:12:22 +00:00
2022-09-03 13:44:00 +00:00
ScrollbarMiscHandle = { fg = c.purple , bg = c.bg_highlight } ,
ScrollbarMisc = { fg = c.purple , bg = c.none } ,
2022-09-02 06:12:22 +00:00
2022-09-02 05:54:15 +00:00
-- Mini
2022-09-12 05:51:08 +00:00
MiniCompletionActiveParameter = { underline = true } ,
2022-09-02 05:54:15 +00:00
MiniCursorword = { bg = c.fg_gutter } ,
MiniCursorwordCurrent = { bg = c.fg_gutter } ,
MiniIndentscopeSymbol = { fg = c.blue1 } ,
2022-09-12 05:51:08 +00:00
MiniIndentscopePrefix = { nocombine = true } , -- Make it invisible
2022-09-02 05:54:15 +00:00
MiniJump = { fg = c.bg_highlight , bg = c.magenta } ,
2022-09-12 05:51:08 +00:00
MiniJump2dSpot = { fg = c.magenta2 , bold = true , nocombine = true } ,
2022-09-02 05:54:15 +00:00
2022-09-12 05:51:08 +00:00
MiniStarterCurrent = { nocombine = true } ,
MiniStarterFooter = { fg = c.yellow , italic = true } ,
2022-09-02 05:54:15 +00:00
MiniStarterHeader = { fg = c.blue } ,
2022-09-10 07:35:41 +00:00
MiniStarterInactive = { fg = c.comment , style = options.styles . comments } ,
MiniStarterItem = { fg = c.fg , bg = options.transparent and c.none or c.bg } ,
2022-09-02 05:54:15 +00:00
MiniStarterItemBullet = { fg = c.border_highlight } ,
MiniStarterItemPrefix = { fg = c.warning } ,
2022-09-03 13:44:00 +00:00
MiniStarterSection = { fg = c.blue1 } ,
2022-09-02 05:54:15 +00:00
MiniStarterQuery = { fg = c.info } ,
MiniStatuslineDevinfo = { fg = c.fg_dark , bg = c.bg_highlight } ,
MiniStatuslineFileinfo = { fg = c.fg_dark , bg = c.bg_highlight } ,
MiniStatuslineFilename = { fg = c.fg_dark , bg = c.fg_gutter } ,
MiniStatuslineInactive = { fg = c.blue , bg = c.bg_statusline } ,
2022-09-12 05:51:08 +00:00
MiniStatuslineModeCommand = { fg = c.black , bg = c.yellow , bold = true } ,
MiniStatuslineModeInsert = { fg = c.black , bg = c.green , bold = true } ,
MiniStatuslineModeNormal = { fg = c.black , bg = c.blue , bold = true } ,
MiniStatuslineModeOther = { fg = c.black , bg = c.teal , bold = true } ,
MiniStatuslineModeReplace = { fg = c.black , bg = c.red , bold = true } ,
MiniStatuslineModeVisual = { fg = c.black , bg = c.magenta , bold = true } ,
2022-09-02 05:54:15 +00:00
MiniSurround = { bg = c.orange , fg = c.black } ,
MiniTablineCurrent = { fg = c.fg , bg = c.fg_gutter } ,
MiniTablineFill = { bg = c.black } ,
MiniTablineHidden = { fg = c.dark5 , bg = c.bg_statusline } ,
MiniTablineModifiedCurrent = { fg = c.warning , bg = c.fg_gutter } ,
MiniTablineModifiedHidden = { bg = c.bg_statusline , fg = util.darken ( c.warning , 0.7 ) } ,
MiniTablineModifiedVisible = { fg = c.warning , bg = c.bg_statusline } ,
MiniTablineTabpagesection = { bg = c.bg_statusline , fg = c.none } ,
MiniTablineVisible = { fg = c.fg , bg = c.bg_statusline } ,
2022-09-12 05:51:08 +00:00
MiniTestEmphasis = { bold = true } ,
MiniTestFail = { fg = c.red , bold = true } ,
MiniTestPass = { fg = c.green , bold = true } ,
2022-09-02 05:54:15 +00:00
MiniTrailspace = { bg = c.red } ,
2021-04-20 11:39:38 +00:00
}
2021-04-19 12:39:35 +00:00
2022-09-05 18:32:31 +00:00
if not vim.diagnostic then
local severity_map = {
Error = " Error " ,
Warn = " Warning " ,
Info = " Information " ,
Hint = " Hint " ,
}
local types = { " Default " , " VirtualText " , " Underline " }
for _ , type in ipairs ( types ) do
for snew , sold in pairs ( severity_map ) do
theme.highlights [ " LspDiagnostics " .. type .. sold ] = {
link = " Diagnostic " .. ( type == " Default " and " " or type ) .. snew ,
}
end
end
end
2021-08-05 11:51:06 +00:00
theme.defer = { }
2022-09-10 07:35:41 +00:00
if options.hide_inactive_statusline then
2022-09-12 05:51:08 +00:00
local inactive = { underline = true , bg = c.none , fg = c.bg , sp = c.border }
2021-04-19 12:39:35 +00:00
2021-04-20 11:39:38 +00:00
-- StatusLineNC
2022-09-05 18:32:31 +00:00
theme.highlights . StatusLineNC = inactive
2021-04-20 11:39:38 +00:00
-- LuaLine
for _ , section in ipairs ( { " a " , " b " , " c " } ) do
2021-08-05 11:51:06 +00:00
theme.defer [ " lualine_ " .. section .. " _inactive " ] = inactive
2021-04-20 11:39:38 +00:00
end
2022-09-02 05:54:15 +00:00
-- mini.statusline
2022-09-05 18:32:31 +00:00
theme.highlights . MiniStatuslineInactive = inactive
2021-04-19 12:39:35 +00:00
end
2022-09-10 07:35:41 +00:00
options.on_highlights ( theme.highlights , theme.colors )
2022-09-05 18:32:31 +00:00
2022-09-10 07:35:41 +00:00
if config.is_day ( ) then
2022-09-05 12:06:03 +00:00
util.invert_colors ( theme.colors )
2022-09-05 18:32:31 +00:00
util.invert_highlights ( theme.highlights )
2022-09-05 12:06:03 +00:00
end
2021-04-20 11:39:38 +00:00
return theme
end
2021-04-17 19:22:55 +00:00
2021-04-20 11:39:38 +00:00
return M