clean up: removed unneeded code

dev-remaster
Pocco81 3 years ago
parent 1eacd7ddb1
commit 0b177ad1cb

@ -1,24 +0,0 @@
local M = {}
local remaps_mod = require("catppuccino.core.remaps")
function M.get_color_scheme(cs)
cs = cs or "dark_catppuccino"
local remaps = remaps_mod.get_cs_remaps() or {}
local good, color_scheme = pcall(require, "catppuccino.color_schemes." .. cs)
if not good then
return {
status = false,
msg = "Catppuccino: the colorscheme '" .. cs .. "' was not recognized. Defaulting to Dark Catppuccino.",
},
require("catppuccino.color_schemes.dark_catppuccino")
end
if not (next(remaps) == nil) then
return { status = true }, vim.tbl_deep_extend("force", color_scheme, remaps)
else
return { status = true }, color_scheme
end
end
return M

@ -2,9 +2,9 @@ local M = {}
function M.get(cpt) function M.get(cpt)
return { return {
GitSignsAdd = { fg = cpt.diff.add, bg = cpc.transparency and cpt.none or cpt.bg }, -- diff mode: Added line |diff.txt| GitSignsAdd = { fg = cpt.diff.add, bg = cnf.transparency and cpt.none or cpt.bg }, -- diff mode: Added line |diff.txt|
GitSignsChange = { fg = cpt.diff.change, bg = cpc.transparency and cpt.none or cpt.bg }, -- diff mode: Changed line |diff.txt| GitSignsChange = { fg = cpt.diff.change, bg = cnf.transparency and cpt.none or cpt.bg }, -- diff mode: Changed line |diff.txt|
GitSignsDelete = { fg = cpt.diff.remove, bg = cpc.transparency and cpt.none or cpt.bg }, -- diff mode: Deleted line |diff.txt| GitSignsDelete = { fg = cpt.diff.remove, bg = cnf.transparency and cpt.none or cpt.bg }, -- diff mode: Deleted line |diff.txt|
} }
end end

@ -6,7 +6,7 @@ function M.get(cpt)
IndentBlanklineChar = { fg = cpt.gray }, IndentBlanklineChar = { fg = cpt.gray },
} }
if cpc.integrations.indent_blankline.colored_indent_levels then if cnf.integrations.indent_blankline.colored_indent_levels then
hi["IndentBlanklineIndent6"] = {blend = "nocombine", fg = cpt.yellow} hi["IndentBlanklineIndent6"] = {blend = "nocombine", fg = cpt.yellow}
hi["IndentBlanklineIndent5"] = {blend = "nocombine", fg = cpt.red} hi["IndentBlanklineIndent5"] = {blend = "nocombine", fg = cpt.red}
hi["IndentBlanklineIndent4"] = {blend = "nocombine", fg = cpt.green} hi["IndentBlanklineIndent4"] = {blend = "nocombine", fg = cpt.green}

@ -2,8 +2,8 @@ local M = {}
function M.get(cpt) function M.get(cpt)
local virtual_text = cpc.integrations.native_lsp.virtual_text local virtual_text = cnf.integrations.native_lsp.virtual_text
local underlines = cpc.integrations.native_lsp.underlines local underlines = cnf.integrations.native_lsp.underlines
return { return {
-- These groups are for the native LSP cliencpt. Some other LSP clients may -- These groups are for the native LSP cliencpt. Some other LSP clients may

@ -11,29 +11,29 @@ function M.get(cpt)
-- TSAnnotation = { }; -- For C++/Dart attributes, annotations that can be attached to the code to denote some kind of meta information. -- TSAnnotation = { }; -- For C++/Dart attributes, annotations that can be attached to the code to denote some kind of meta information.
-- TSAttribute = { }; -- (unstable) TODO: docs -- TSAttribute = { }; -- (unstable) TODO: docs
TSBoolean = { fg = cpt.orange_br, style = cpc.styles.keywords }, -- For booleans. TSBoolean = { fg = cpt.orange_br, style = cnf.styles.keywords }, -- For booleans.
-- TSCharacter = { }; -- For characters. -- TSCharacter = { }; -- For characters.
-- TSComment = { }; -- For comment blocks. -- TSComment = { }; -- For comment blocks.
TSNote = { fg = cpt.bg, bg = cpt.info }, TSNote = { fg = cpt.bg, bg = cpt.info },
TSWarning = { fg = cpt.bg, bg = cpt.warning }, TSWarning = { fg = cpt.bg, bg = cpt.warning },
TSDanger = { fg = cpt.bg, bg = cpt.error }, TSDanger = { fg = cpt.bg, bg = cpt.error },
TSConstructor = { fg = cpt.magenta }, -- For constructor calls and definitions: `= { }` in Lua, and Java constructors. TSConstructor = { fg = cpt.magenta }, -- For constructor calls and definitions: `= { }` in Lua, and Java constructors.
TSConditional = { fg = cpt.red, style = cpc.styles.keywords }, -- For keywords related to conditionnals. TSConditional = { fg = cpt.red, style = cnf.styles.keywords }, -- For keywords related to conditionnals.
TSConstant = { fg = cpt.orange }, -- For constants TSConstant = { fg = cpt.orange }, -- For constants
TSConstBuiltin = { fg = cpt.orange_br, style = cpc.styles.keywords }, -- For constant that are built in the language: `nil` in Lua. TSConstBuiltin = { fg = cpt.orange_br, style = cnf.styles.keywords }, -- For constant that are built in the language: `nil` in Lua.
-- TSConstMacro = { }; -- For constants that are defined by macros: `NULL` in cpt. -- TSConstMacro = { }; -- For constants that are defined by macros: `NULL` in cpt.
-- TSError = { }; -- For syntax/parser errors. -- TSError = { }; -- For syntax/parser errors.
TSException = { fg = cpt.magenta_br, style = cpc.styles.keywords }, -- For exception related keywords. TSException = { fg = cpt.magenta_br, style = cnf.styles.keywords }, -- For exception related keywords.
TSField = { fg = cpt.red }, -- For fields. TSField = { fg = cpt.red }, -- For fields.
rustTSField = { fg = util.darken(cpt.white, 0.75) }, -- For fields. rustTSField = { fg = util.darken(cpt.white, 0.75) }, -- For fields.
-- TSFloat = { }; -- For floats. -- TSFloat = { }; -- For floats.
TSFunction = { fg = cpt.blue, style = cpc.styles.functions }, -- For function (calls and definitions). TSFunction = { fg = cpt.blue, style = cnf.styles.functions }, -- For function (calls and definitions).
TSFuncBuiltin = { fg = cpt.cyan }, -- For builtin functions: `table.insert` in Lua. TSFuncBuiltin = { fg = cpt.cyan }, -- For builtin functions: `table.insert` in Lua.
TSFuncMacro = { fg = cpt.red }, -- For macro defined functions (calls and definitions): each `macro_rules` in Ruscpt. TSFuncMacro = { fg = cpt.red }, -- For macro defined functions (calls and definitions): each `macro_rules` in Ruscpt.
TSInclude = { fg = cpt.magenta, style = cpc.styles.keywords }, -- For includes: `#include` in C, `use` or `extern crate` in Rust, or `require` in Lua. TSInclude = { fg = cpt.magenta, style = cnf.styles.keywords }, -- For includes: `#include` in C, `use` or `extern crate` in Rust, or `require` in Lua.
TSKeyword = { fg = cpt.magenta, style = cpc.styles.keywords }, -- For keywords that don't fall in previous categories. TSKeyword = { fg = cpt.magenta, style = cnf.styles.keywords }, -- For keywords that don't fall in previous categories.
TSKeywordFunction = { fg = cpt.magenta_br, style = cpc.styles.keywords }, -- For keywords used to define a fuction. TSKeywordFunction = { fg = cpt.magenta_br, style = cnf.styles.keywords }, -- For keywords used to define a fuction.
TSKeywordOperator = { fg = cpt.cyan, style = cpc.styles.keywords }, -- For `new` keyword operator TSKeywordOperator = { fg = cpt.cyan, style = cnf.styles.keywords }, -- For `new` keyword operator
TSLabel = { fg = cpt.blue }, -- For labels: `label:` in C and `:label:` in Lua. TSLabel = { fg = cpt.blue }, -- For labels: `label:` in C and `:label:` in Lua.
-- TSMethod = { }; -- For method calls and definitions. -- TSMethod = { }; -- For method calls and definitions.
TSNamespace = { fg = cpt.cyan }, -- For identifiers referring to modules and namespaces. TSNamespace = { fg = cpt.cyan }, -- For identifiers referring to modules and namespaces.
@ -47,15 +47,15 @@ function M.get(cpt)
TSPunctDelimiter = { fg = cpt.green_br }, -- For delimiters ie: `.` TSPunctDelimiter = { fg = cpt.green_br }, -- For delimiters ie: `.`
TSPunctBracket = { fg = cpt.red }, -- For brackets and parenthesis. TSPunctBracket = { fg = cpt.red }, -- For brackets and parenthesis.
TSPunctSpecial = { fg = cpt.white }, -- For special punctutation that does not fall in the catagories before. TSPunctSpecial = { fg = cpt.white }, -- For special punctutation that does not fall in the catagories before.
TSRepeat = { fg = cpt.red, style = cpc.styles.keywords }, -- For keywords related to loops. TSRepeat = { fg = cpt.red, style = cnf.styles.keywords }, -- For keywords related to loops.
-- TSString = { }; -- For strings. -- TSString = { }; -- For strings.
TSStringRegex = { fg = cpt.blue, style = cpc.styles.strings }, -- For regexes. TSStringRegex = { fg = cpt.blue, style = cnf.styles.strings }, -- For regexes.
TSStringEscape = { fg = cpt.magenta, style = cpc.styles.strings }, -- For escape characters within a string. TSStringEscape = { fg = cpt.magenta, style = cnf.styles.strings }, -- For escape characters within a string.
-- TSSymbol = { }; -- For identifiers referring to symbols or atoms. -- TSSymbol = { }; -- For identifiers referring to symbols or atoms.
-- TSType = { }; -- For types. -- TSType = { }; -- For types.
TSTypeBuiltin = { fg = cpt.cyan, style = cpc.styles.keywords }, -- For builtin types. TSTypeBuiltin = { fg = cpt.cyan, style = cnf.styles.keywords }, -- For builtin types.
TSVariable = { style = cpc.styles.variables }, -- Any variable name that does not have another highlighcpt. TSVariable = { style = cnf.styles.variables }, -- Any variable name that does not have another highlighcpt.
TSVariableBuiltin = { fg = cpt.red, style = cpc.styles.keywords }, -- Variable names that are defined by the languages, like `this` or `self`. TSVariableBuiltin = { fg = cpt.red, style = cnf.styles.keywords }, -- Variable names that are defined by the languages, like `this` or `self`.
-- TSTag = { }; -- Tags like html tag names. -- TSTag = { }; -- Tags like html tag names.
-- TSTagDelimiter = { }; -- Tag delimiter like `<` `>` `/` -- TSTagDelimiter = { }; -- Tag delimiter like `<` `>` `/`
-- TSText = { }; -- For strings considered text in a markup language. -- TSText = { }; -- For strings considered text in a markup language.

@ -1,76 +1,80 @@
local util = require("catppuccino.utils.util") local util = require("catppuccino.utils.util")
local colors_util = require("catppuccino.utils.colors") local colors_util = require("catppuccino.utils.colors")
local color_palette = require("catppuccino.core.color_palette")
local M = {} local M = {}
local _cs local function get_properties()
local props = {
termguicolors = true,
background = "dark",
}
local function get_cs() -- return a cleaned and parsed colorscheme if colors_util.assert_brightness(color_palette.bg) then
return _cs props["background"] = "light"
end end
local function set_cs(val) return props
_cs = val
end end
local function get_base() local function get_base()
local cpt = get_cs() local cp = color_palette
return { return {
Comment = { fg = cpt.comment, style = cpc.styles.comments }, -- any comment Comment = { fg = cp.comment, style = cnf.styles.comments }, -- any comment
ColorColumn = { bg = cpt.bg_visual }, -- used for the columns set with 'colorcolumn' ColorColumn = { bg = cp.bg_visual }, -- used for the columns set with 'colorcolumn'
Conceal = { fg = cpt.black }, -- placeholder characters substituted for concealed text (see 'conceallevel') Conceal = { fg = cp.black }, -- placeholder characters substituted for concealed text (see 'conceallevel')
Cursor = { fg = cpt.bg, bg = cpt.fg }, -- character under the cursor Cursor = { fg = cp.bg, bg = cp.fg }, -- character under the cursor
lCursor = { fg = cpt.bg, bg = cpt.fg }, -- the character under the cursor when |language-mapping| is used (see 'guicursor') lCursor = { fg = cp.bg, bg = cp.fg }, -- the character under the cursor when |language-mapping| is used (see 'guicursor')
CursorIM = { fg = cpt.bg, bg = cpt.fg }, -- like Cursor, but used when in IME mode |CursorIM| CursorIM = { fg = cp.bg, bg = cp.fg }, -- like Cursor, but used when in IME mode |CursorIM|
CursorColumn = { bg = cpt.bg_highlight }, -- Screen-column at the cursor, when 'cursorcolumn' is secpt. CursorColumn = { bg = cp.bg_highlight }, -- Screen-column at the cursor, when 'cursorcolumn' is secp.
CursorLine = { bg = cpt.bg_highlight }, -- Screen-line at the cursor, when 'cursorline' is secpt. Low-priority if foreground (ctermfg OR guifg) is not secpt. CursorLine = { bg = cp.bg_highlight }, -- Screen-line at the cursor, when 'cursorline' is secp. Low-priority if foreground (ctermfg OR guifg) is not secp.
Directory = { fg = cpt.blue }, -- directory names (and other special names in listings) Directory = { fg = cp.blue }, -- directory names (and other special names in listings)
EndOfBuffer = { fg = cpt.bg }, -- filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|. EndOfBuffer = { fg = cp.bg }, -- filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|.
ErrorMsg = { fg = cpt.error }, -- error messages on the command line ErrorMsg = { fg = cp.error }, -- error messages on the command line
VertSplit = { fg = cpt.border }, -- the column separating vertically split windows VertSplit = { fg = cp.border }, -- the column separating vertically split windows
Folded = { fg = cpt.blue, bg = cpt.fg_gutter }, -- line used for closed folds Folded = { fg = cp.blue, bg = cp.fg_gutter }, -- line used for closed folds
FoldColumn = { bg = cpt.bg, fg = cpt.comment }, -- 'foldcolumn' FoldColumn = { bg = cp.bg, fg = cp.comment }, -- 'foldcolumn'
SignColumn = { bg = cpc.transparency and cpt.none or cpt.bg, fg = cpt.fg_gutter }, -- column where |signs| are displayed SignColumn = { bg = cnf.transparency and cp.none or cp.bg, fg = cp.fg_gutter }, -- column where |signs| are displayed
SignColumnSB = { bg = cpt.bg_sidebar, fg = cpt.fg_gutter }, -- column where |signs| are displayed SignColumnSB = { bg = cp.bg_sidebar, fg = cp.fg_gutter }, -- column where |signs| are displayed
Substitute = { bg = cpt.red, fg = cpt.black }, -- |:substitute| replacement text highlighting Substitute = { bg = cp.red, fg = cp.black }, -- |:substitute| replacement text highlighting
LineNr = { fg = cpt.fg_gutter }, -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is secpt. LineNr = { fg = cp.fg_gutter }, -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is secp.
CursorLineNr = { fg = cpt.fg_alt }, -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line. highlights the number in numberline. CursorLineNr = { fg = cp.fg_alt }, -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line. highlights the number in numberline.
MatchParen = { fg = cpt.orange, style = "bold" }, -- The character under the cursor or just before it, if it is a paired bracket, and its match. |pi_paren.txt| MatchParen = { fg = cp.orange, style = "bold" }, -- The character under the cursor or just before it, if it is a paired bracket, and its match. |pi_paren.txt|
ModeMsg = { fg = cpt.fg_alt, style = "bold" }, -- 'showmode' message (e.g., "-- INSERT -- ") ModeMsg = { fg = cp.fg_alt, style = "bold" }, -- 'showmode' message (e.g., "-- INSERT -- ")
MsgArea = { fg = cpt.white_br }, -- Area for messages and cmdline MsgArea = { fg = cp.white_br }, -- Area for messages and cmdline
MsgSeparator = {}, -- Separator for scrolled messages, `msgsep` flag of 'display' MsgSeparator = {}, -- Separator for scrolled messages, `msgsep` flag of 'display'
MoreMsg = { fg = cpt.blue }, -- |more-prompt| MoreMsg = { fg = cp.blue }, -- |more-prompt|
NonText = { fg = cpt.comment }, -- '@' 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|. NonText = { fg = cp.comment }, -- '@' 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|.
Normal = { fg = cpt.fg, bg = cpc.transparency and cpt.none or cpt.bg }, -- normal text Normal = { fg = cp.fg, bg = cnf.transparency and cp.none or cp.bg }, -- normal text
NormalNC = { fg = cpt.fg, bg = cpc.transparency and cpt.none or cpt.bg }, -- normal text in non-current windows NormalNC = { fg = cp.fg, bg = cnf.transparency and cp.none or cp.bg }, -- normal text in non-current windows
NormalSB = { fg = cpt.fg_sidebar, bg = cpt.bg_sidebar }, -- normal text in non-current windows NormalSB = { fg = cp.fg_sidebar, bg = cp.bg_sidebar }, -- normal text in non-current windows
NormalFloat = { fg = cpt.fg, bg = cpt.bg_float }, -- Normal text in floating windows. NormalFloat = { fg = cp.fg, bg = cp.bg_float }, -- Normal text in floating windows.
FloatBorder = { fg = cpt.border_highlight }, FloatBorder = { fg = cp.border_highlight },
Pmenu = { bg = cpt.bg_popup, fg = cpt.fg }, -- Popup menu: normal item. Pmenu = { bg = cp.bg_popup, fg = cp.fg }, -- Popup menu: normal item.
PmenuSel = { fg = cpt.cyan, bg = util.darken(cpt.fg_gutter, 0.8) }, -- Popup menu: selected item. PmenuSel = { fg = cp.cyan, bg = util.darken(cp.fg_gutter, 0.8) }, -- Popup menu: selected item.
PmenuSbar = { bg = util.lighten(cpt.bg_popup, 0.95) }, -- Popup menu: scrollbar. PmenuSbar = { bg = util.lighten(cp.bg_popup, 0.95) }, -- Popup menu: scrollbar.
PmenuThumb = { bg = cpt.fg_gutter }, -- Popup menu: Thumb of the scrollbar. PmenuThumb = { bg = cp.fg_gutter }, -- Popup menu: Thumb of the scrollbar.
Question = { fg = cpt.blue }, -- |hit-enter| prompt and yes/no questions Question = { fg = cp.blue }, -- |hit-enter| prompt and yes/no questions
QuickFixLine = { bg = cpt.bg_visual, style = "bold" }, -- Current |quickfix| item in the quickfix window. Combined with |hl-CursorLine| when the cursor is there. QuickFixLine = { bg = cp.bg_visual, style = "bold" }, -- Current |quickfix| item in the quickfix window. Combined with |hl-CursorLine| when the cursor is there.
Search = { bg = cpt.bg_search, fg = cpt.fg }, -- Last search pattern highlighting (see 'hlsearch'). Also used for similar items that need to stand oucpt. Search = { bg = cp.bg_search, fg = cp.fg }, -- Last search pattern highlighting (see 'hlsearch'). Also used for similar items that need to stand oucp.
IncSearch = { bg = cpt.cyan, fg = cpt.black }, -- 'incsearch' highlighting; also used for the text replaced with ":s///c" IncSearch = { bg = cp.cyan, fg = cp.black }, -- 'incsearch' highlighting; also used for the text replaced with ":s///c"
SpecialKey = { fg = cpt.fg }, -- Unprintable characters: text displayed differently from what it really is. But not 'listchars' whitespace. |hl-Whitespace| SpecialKey = { fg = cp.fg }, -- Unprintable characters: text displayed differently from what it really is. But not 'listchars' whitespace. |hl-Whitespace|
SpellBad = { sp = cpt.error, style = "undercurl" }, -- Word that is not recognized by the spellchecker. |spell| Combined with the highlighting used otherwise. SpellBad = { sp = cp.error, style = "undercurl" }, -- Word that is not recognized by the spellchecker. |spell| Combined with the highlighting used otherwise.
SpellCap = { sp = cpt.warning, style = "undercurl" }, -- Word that should start with a capital. |spell| Combined with the highlighting used otherwise. SpellCap = { sp = cp.warning, style = "undercurl" }, -- Word that should start with a capital. |spell| Combined with the highlighting used otherwise.
SpellLocal = { sp = cpt.info, style = "undercurl" }, -- Word that is recognized by the spellchecker as one that is used in another region. |spell| Combined with the highlighting used otherwise. SpellLocal = { sp = cp.info, style = "undercurl" }, -- Word that is recognized by the spellchecker as one that is used in another region. |spell| Combined with the highlighting used otherwise.
SpellRare = { sp = cpt.hint, style = "undercurl" }, -- Word that is recognized by the spellchecker as one that is hardly ever used. |spell| Combined with the highlighting used otherwise. SpellRare = { sp = cp.hint, style = "undercurl" }, -- Word that is recognized by the spellchecker as one that is hardly ever used. |spell| Combined with the highlighting used otherwise.
StatusLine = { fg = cpt.fg_sidebar, bg = cpt.bg_statusline }, -- status line of current window StatusLine = { fg = cp.fg_sidebar, bg = cp.bg_statusline }, -- status line of current window
StatusLineNC = { fg = cpt.fg_gutter, bg = cpt.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. StatusLineNC = { fg = cp.fg_gutter, bg = cp.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.
TabLine = { bg = cpt.bg_statusline, fg = cpt.fg_gutter }, -- tab pages line, not active tab page label TabLine = { bg = cp.bg_statusline, fg = cp.fg_gutter }, -- tab pages line, not active tab page label
TabLineFill = { bg = cpt.black }, -- tab pages line, where there are no labels TabLineFill = { bg = cp.black }, -- tab pages line, where there are no labels
TabLineSel = { fg = cpt.fg_alt, bg = cpt.fg_gutter }, -- tab pages line, active tab page label TabLineSel = { fg = cp.fg_alt, bg = cp.fg_gutter }, -- tab pages line, active tab page label
Title = { fg = cpt.blue, style = "bold" }, -- titles for output from ":set all", ":autocmd" etcpt. Title = { fg = cp.blue, style = "bold" }, -- titles for output from ":set all", ":autocmd" etcp.
Visual = { bg = cpt.bg_visual }, -- Visual mode selection Visual = { bg = cp.bg_visual }, -- Visual mode selection
VisualNOS = { bg = cpt.bg_visual }, -- Visual mode selection when vim is "Not Owning the Selection". VisualNOS = { bg = cp.bg_visual }, -- Visual mode selection when vim is "Not Owning the Selection".
WarningMsg = { fg = cpt.warning }, -- warning messages WarningMsg = { fg = cp.warning }, -- warning messages
Whitespace = { fg = cpt.fg_gutter }, -- "nbsp", "space", "tab" and "trail" in 'listchars' Whitespace = { fg = cp.fg_gutter }, -- "nbsp", "space", "tab" and "trail" in 'listchars'
WildMenu = { bg = cpt.bg_visual }, -- current match in 'wildmenu' completion WildMenu = { bg = cp.bg_visual }, -- current match in 'wildmenu' completion
-- These groups are not listed as default vim groups, -- These groups are not listed as default vim groups,
-- but they are defacto standard group names for syntax highlighting. -- but they are defacto standard group names for syntax highlighting.
-- commented out groups should chain up to their "preferred" group by -- commented out groups should chain up to their "preferred" group by
@ -79,33 +83,33 @@ local function get_base()
-- code itself -- code itself
Constant = { fg = cpt.orange }, -- (preferred) any constant Constant = { fg = cp.orange }, -- (preferred) any constant
String = { fg = cpt.green, style = cpc.styles.strings }, -- a string constant: "this is a string" String = { fg = cp.green, style = cnf.styles.strings }, -- a string constant: "this is a string"
Character = { fg = cpt.green }, -- a character constant: 'c', '\n' Character = { fg = cp.green }, -- a character constant: 'c', '\n'
Number = { fg = cpt.orange_br }, -- a number constant: 234, 0xff Number = { fg = cp.orange_br }, -- a number constant: 234, 0xff
Float = { fg = cpt.orange_br }, -- a floating point constant: 2.3e10 Float = { fg = cp.orange_br }, -- a floating point constant: 2.3e10
Boolean = { fg = cpt.orange_br }, -- a boolean constant: TRUE, false Boolean = { fg = cp.orange_br }, -- a boolean constant: TRUE, false
Identifier = { fg = cpt.cyan, style = cpc.styles.variables }, -- (preferred) any variable name Identifier = { fg = cp.cyan, style = cnf.styles.variables }, -- (preferred) any variable name
Function = { fg = cpt.blue, style = cpc.styles.functions }, -- function name (also: methods for classes) Function = { fg = cp.blue, style = cnf.styles.functions }, -- function name (also: methods for classes)
Statement = { fg = cpt.magenta_br }, -- (preferred) any statement Statement = { fg = cp.magenta_br }, -- (preferred) any statement
Conditional = { fg = cpt.red }, -- if, then, else, endif, switch, etcpt. Conditional = { fg = cp.red }, -- if, then, else, endif, switch, etcp.
Repeat = { fg = cpt.red }, -- for, do, while, etcpt. Repeat = { fg = cp.red }, -- for, do, while, etcp.
Label = { fg = cpt.magenta_br }, -- case, default, etcpt. Label = { fg = cp.magenta_br }, -- case, default, etcp.
Operator = { fg = cpt.fg_alt }, -- "sizeof", "+", "*", etcpt. Operator = { fg = cp.fg_alt }, -- "sizeof", "+", "*", etcp.
Keyword = { fg = cpt.magenta, style = cpc.styles.keywords }, -- any other keyword Keyword = { fg = cp.magenta, style = cnf.styles.keywords }, -- any other keyword
-- Exception = { }, -- try, catch, throw -- Exception = { }, -- try, catch, throw
PreProc = { fg = cpt.pink }, -- (preferred) generic Preprocessor PreProc = { fg = cp.pink }, -- (preferred) generic Preprocessor
Include = { fg = cpt.pink }, -- preprocessor #include Include = { fg = cp.pink }, -- preprocessor #include
-- Define = { }, -- preprocessor #define -- Define = { }, -- preprocessor #define
-- Macro = { }, -- same as Define -- Macro = { }, -- same as Define
-- PreCondit = { }, -- preprocessor #if, #else, #endif, etcpt. -- PreCondit = { }, -- preprocessor #if, #else, #endif, etcp.
Type = { fg = cpt.yellow }, -- (preferred) int, long, char, etcpt. Type = { fg = cp.yellow }, -- (preferred) int, long, char, etcp.
StorageClass = { fg = cpt.yellow }, -- static, register, volatile, etcpt. StorageClass = { fg = cp.yellow }, -- static, register, volatile, etcp.
Structure = { fg = cpt.yellow }, -- struct, union, enum, etcpt. Structure = { fg = cp.yellow }, -- struct, union, enum, etcp.
Typedef = { fg = cpt.yellow }, -- A typedef Typedef = { fg = cp.yellow }, -- A typedef
Special = { fg = cpt.blue }, -- (preferred) any special symbol Special = { fg = cp.blue }, -- (preferred) any special symbol
-- SpecialChar = { }, -- special character in a constant -- SpecialChar = { }, -- special character in a constant
-- Tag = { }, -- you can use CTRL-] on this -- Tag = { }, -- you can use CTRL-] on this
-- Delimiter = { }, -- character that needs attention -- Delimiter = { }, -- character that needs attention
@ -118,59 +122,59 @@ local function get_base()
-- ("Ignore", below, may be invisible...) -- ("Ignore", below, may be invisible...)
-- Ignore = { }, -- (preferred) left blank, hidden |hl-Ignore| -- Ignore = { }, -- (preferred) left blank, hidden |hl-Ignore|
Error = { fg = cpt.error }, -- (preferred) any erroneous construct Error = { fg = cp.error }, -- (preferred) any erroneous construct
Todo = { bg = cpt.yellow, fg = cpt.bg, style = "bold" }, -- (preferred) anything that needs extra attention; mostly the keywords TODO FIXME and XXX Todo = { bg = cp.yellow, fg = cp.bg, style = "bold" }, -- (preferred) anything that needs extra attention; mostly the keywords TODO FIXME and XXX
qfLineNr = { fg = cpt.yellow }, qfLineNr = { fg = cp.yellow },
qfFileName = { fg = cpt.blue }, qfFileName = { fg = cp.blue },
htmlH1 = { fg = cpt.magenta, style = "bold" }, htmlH1 = { fg = cp.magenta, style = "bold" },
htmlH2 = { fg = cpt.blue, style = "bold" }, htmlH2 = { fg = cp.blue, style = "bold" },
-- mkdHeading = { fg = cpt.orange, style = "bold" }, -- mkdHeading = { fg = cp.orange, style = "bold" },
-- mkdCode = { bg = cpt.terminal_black, fg = cpt.fg }, -- mkdCode = { bg = cp.terminal_black, fg = cp.fg },
mkdCodeDelimiter = { bg = cpt.terminal_black, fg = cpt.fg }, mkdCodeDelimiter = { bg = cp.terminal_black, fg = cp.fg },
mkdCodeStart = { fg = cpt.cyan, style = "bold" }, mkdCodeStart = { fg = cp.cyan, style = "bold" },
mkdCodeEnd = { fg = cpt.cyan, style = "bold" }, mkdCodeEnd = { fg = cp.cyan, style = "bold" },
-- mkdLink = { fg = cpt.blue, style = "underline" }, -- mkdLink = { fg = cp.blue, style = "underline" },
-- debugging -- debugging
debugPC = { bg = cpt.bg_sidebar }, -- used for highlighting the current line in terminal-debug debugPC = { bg = cp.bg_sidebar }, -- used for highlighting the current line in terminal-debug
debugBreakpoint = { bg = util.darken(cpt.info, 0.1), fg = cpt.info }, -- used for breakpoint colors in terminal-debug debugBreakpoint = { bg = util.darken(cp.info, 0.1), fg = cp.info }, -- used for breakpoint colors in terminal-debug
-- illuminate -- illuminate
illuminatedWord = { bg = cpt.fg_gutter }, illuminatedWord = { bg = cp.fg_gutter },
illuminatedCurWord = { bg = cpt.fg_gutter }, illuminatedCurWord = { bg = cp.fg_gutter },
-- diff -- diff
diffAdded = { fg = cpt.diff.add }, diffAdded = { fg = cp.diff.add },
diffRemoved = { fg = cpt.diff.delete }, diffRemoved = { fg = cp.diff.delete },
diffChanged = { fg = cpt.diff.change }, diffChanged = { fg = cp.diff.change },
diffOldFile = { fg = cpt.yellow }, diffOldFile = { fg = cp.yellow },
diffNewFile = { fg = cpt.orange }, diffNewFile = { fg = cp.orange },
diffFile = { fg = cpt.blue }, diffFile = { fg = cp.blue },
diffLine = { fg = cpt.comment }, diffLine = { fg = cp.comment },
diffIndexLine = { fg = cpt.magenta }, diffIndexLine = { fg = cp.magenta },
DiffAdd = { fg = cpt.diff.add, bg = cpt.bg }, -- diff mode: Added line |diff.txt| DiffAdd = { fg = cp.diff.add, bg = cp.bg }, -- diff mode: Added line |diff.txt|
DiffChange = { fg = cpt.diff.change, bg = cpt.bg }, -- diff mode: Changed line |diff.txt| DiffChange = { fg = cp.diff.change, bg = cp.bg }, -- diff mode: Changed line |diff.txt|
DiffDelete = { fg = cpt.diff.delete, bg = cpt.bg }, -- diff mode: Deleted line |diff.txt| DiffDelete = { fg = cp.diff.delete, bg = cp.bg }, -- diff mode: Deleted line |diff.txt|
DiffText = { fg = cpt.diff.text, bg = cpt.bg }, -- diff mode: Changed text within a changed line |diff.txt| DiffText = { fg = cp.diff.text, bg = cp.bg }, -- diff mode: Changed text within a changed line |diff.txt|
-- NeoVim -- NeoVim
healthError = { fg = cpt.error }, healthError = { fg = cp.error },
healthSuccess = { fg = cpt.green_br }, healthSuccess = { fg = cp.green_br },
healthWarning = { fg = cpt.warning }, healthWarning = { fg = cp.warning },
-- misc -- misc
-- glyphs -- glyphs
GlyphPalette1 = { fg = cpt.red }, GlyphPalette1 = { fg = cp.red },
GlyphPalette2 = { fg = cpt.green }, GlyphPalette2 = { fg = cp.green },
GlyphPalette3 = { fg = cpt.yellow }, GlyphPalette3 = { fg = cp.yellow },
GlyphPalette4 = { fg = cpt.blue }, GlyphPalette4 = { fg = cp.blue },
GlyphPalette6 = { fg = cpt.green_br }, GlyphPalette6 = { fg = cp.green_br },
GlyphPalette7 = { fg = cpt.fg }, GlyphPalette7 = { fg = cp.fg },
GlyphPalette9 = { fg = cpt.red }, GlyphPalette9 = { fg = cp.red },
} }
end end
local function get_integrations() local function get_integrations()
local integrations = cpc["integrations"] local integrations = cnf["integrations"]
local final_integrations = {} local final_integrations = {}
local cpt = get_cs() local cp = color_palette
for integration in pairs(integrations) do for integration in pairs(integrations) do
local cot = false local cot = false
@ -185,50 +189,50 @@ local function get_integrations()
end end
if cot then if cot then
final_integrations = vim.tbl_deep_extend("force", final_integrations, require("catppuccino.core.integrations." .. integration).get(cpt)) final_integrations = vim.tbl_deep_extend(
"force",
final_integrations,
require("catppuccino.core.integrations." .. integration).get(cp)
)
end end
end end
final_integrations = vim.tbl_deep_extend("force", final_integrations, require("catppuccino.core.remaps").get_hig_remaps() or {}) final_integrations = vim.tbl_deep_extend(
"force",
final_integrations,
require("catppuccino.core.remaps").get_hig_remaps() or {}
)
return final_integrations return final_integrations
end end
local function get_properties() local function get_terminal()
local cpt = get_cs() local g = vim.g
local props = { local cp = color_palette
termguicolors = true,
background = "dark", g.terminal_color_0 = cp.catppuccino0
} g.terminal_color_1 = cp.catppuccino1
g.terminal_color_2 = cp.catppuccino2
if colors_util.assert_brightness(cpt.bg) then g.terminal_color_3 = cp.catppuccino3
props["background"] = "light" g.terminal_color_4 = cp.catppuccino4
end g.terminal_color_5 = cp.catppuccino5
g.terminal_color_6 = cp.catppuccino6
return props g.terminal_color_7 = cp.catppuccino7
end g.terminal_color_8 = cp.catppuccino8
g.terminal_color_9 = cp.catppuccino9
function M.apply(cs) g.terminal_color_10 = cp.catppuccino10
_G.cpc = require("catppuccino.config").options
cs = cs or cpc.colorscheme
local err, color_scheme = require("catppuccino.core.cs").get_color_scheme(cs)
-- cpc (global): config; exists while settings are applied
-- cs (local): colorscheme; usually passed to integrations
if not err.status then
vim.api.nvim_err_writeln(err.msg)
end end
set_cs(color_scheme) function M.apply()
_G.cnf = require("catppuccino.config").options
local theme = {} local theme = {}
theme.colors = get_cs() theme.properties = get_properties() -- nvim settings
theme.base = get_base() theme.base = get_base() -- basic hi groups
theme.integrations = get_integrations() theme.integrations = get_integrations() -- plugins
theme.properties = get_properties() theme.terminal = get_terminal() -- terminal colors
-- uninstantiate to avoid poluting global scope and because it's not needed anymore -- uninstantiate to avoid poluting global scope and because it's not needed anymore
_G.cpc = nil _G.cnf = nil
return theme return theme
end end

@ -1,16 +1,7 @@
local M = {} local M = {}
local cs_remaps -- colorscheme
local hig_remaps -- highlight groups local hig_remaps -- highlight groups
function M.get_cs_remaps()
return cs_remaps
end
function M.set_cs_remaps(val)
cs_remaps = val
end
function M.get_hig_remaps() function M.get_hig_remaps()
return hig_remaps return hig_remaps
end end

@ -1,17 +1,12 @@
local M = {} local M = {}
function M.load(args) function M.load()
require("catppuccino.main").main("load", args) require("catppuccino.main").main("load")
end end
function M.remap(colorscheme, hi_groups) function M.remap(hi_groups)
colorscheme = colorscheme or {}
hi_groups = hi_groups or {} hi_groups = hi_groups or {}
require("catppuccino.core.remaps").set_hig_remaps(hi_groups)
local remaps_mod = require("catppuccino.core.remaps")
remaps_mod.set_cs_remaps(colorscheme)
remaps_mod.set_hig_remaps(hi_groups)
end end
function M.setup(custom_opts) function M.setup(custom_opts)

@ -2,7 +2,7 @@ local M = {}
local utils = require("catppuccino.utils.util") local utils = require("catppuccino.utils.util")
local function load(colorscheme) local function load()
local catppuccino = require("catppuccino") local catppuccino = require("catppuccino")
if catppuccino.before_loading ~= nil then if catppuccino.before_loading ~= nil then
@ -10,7 +10,7 @@ local function load(colorscheme)
end end
-- colorscheme gets evaluated from mapper.lua -- colorscheme gets evaluated from mapper.lua
local theme = require("catppuccino.core.mapper").apply(colorscheme) local theme = require("catppuccino.core.mapper").apply()
utils.load(theme) utils.load(theme)
if catppuccino.after_loading ~= nil then if catppuccino.after_loading ~= nil then
@ -22,11 +22,11 @@ local function clear()
vim.cmd("hi clear") vim.cmd("hi clear")
end end
function M.main(option, args) function M.main(option)
option = option or "load" option = option or "load"
if option == "load" then if option == "load" then
load(args) load()
elseif option == "clear" then elseif option == "clear" then
clear() clear()
else else

@ -149,7 +149,7 @@ function util.load(theme)
util.syntax(theme.integrations) util.syntax(theme.integrations)
if require("catppuccino.config").options["term_colors"] then if require("catppuccino.config").options["term_colors"] then
util.terminal(theme.colors) util.terminal(theme.terminal)
end end
end end

Loading…
Cancel
Save