-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added
colorschemes
default configs checks and tests
- Loading branch information
1 parent
a23b40e
commit 4c61267
Showing
4 changed files
with
100 additions
and
5 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
lua/colorscheme-installer/colorschemes/configs/kanagawa.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
return { | ||
compile = false, -- enable compiling the colorscheme | ||
undercurl = true, -- enable undercurls | ||
commentStyle = { italic = true }, | ||
functionStyle = {}, | ||
keywordStyle = { italic = true }, | ||
statementStyle = { bold = true }, | ||
typeStyle = {}, | ||
transparent = false, -- do not set background color | ||
dimInactive = false, -- dim inactive window `:h hl-NormalNC` | ||
terminalColors = true, -- define vim.g.terminal_color_{0,17} | ||
colors = { -- add/modify theme and palette colors | ||
palette = {}, | ||
theme = { wave = {}, lotus = {}, dragon = {}, all = {} }, | ||
}, | ||
overrides = function(colors) -- add/modify highlights | ||
return {} | ||
end, | ||
theme = "wave", -- Load "wave" theme when 'background' option is not set | ||
background = { -- map the value of 'background' option to a theme | ||
dark = "wave", -- try "dragon" ! | ||
light = "lotus", | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
local M = {} | ||
|
||
---Require the colorscheme config | ||
---@param colorscheme string | ||
---@return table | ||
local function get_default_config(colorscheme) | ||
local config = require("colorscheme-installer.colorschemes.configs." .. colorscheme) | ||
return config | ||
end | ||
|
||
---Check if colorscheme is installed | ||
---@param colorscheme string | ||
---@return boolean | ||
local function is_installed(colorscheme) | ||
if vim.g["cs_" .. colorscheme .. "_installed"] then | ||
return vim.g["cs_" .. colorscheme .. "_installed"] | ||
end | ||
local colors = vim.fn.getcompletion("", "color") | ||
for _, color in ipairs(colors) do | ||
if colorscheme == color then | ||
vim.g["cs_" .. colorscheme .. "_installed"] = true | ||
return true | ||
end | ||
end | ||
return false | ||
end | ||
|
||
M.colorschemes = { | ||
{ | ||
repo = "rebelot/kanagawa.nvim", | ||
name = "kanagawa", | ||
default_config = get_default_config("kanagawa"), | ||
installed = is_installed("kanagawa"), | ||
}, | ||
} | ||
|
||
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters