mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 10:21:31 +00:00
themes/solarized: init
This commit is contained in:
parent
32e1e164c1
commit
f7b1b238f7
3 changed files with 66 additions and 2 deletions
|
@ -427,3 +427,9 @@
|
||||||
[theutz](https://github.com/theutz):
|
[theutz](https://github.com/theutz):
|
||||||
|
|
||||||
- Added "auto" flavour for catppuccin theme
|
- Added "auto" flavour for catppuccin theme
|
||||||
|
|
||||||
|
[lackac](https://github.com/lackac):
|
||||||
|
|
||||||
|
[solarized.nvim]: https://github.com/maxmx03/solarized.nvim
|
||||||
|
|
||||||
|
- Add [solarized.nvim] theme with support for multiple variants
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString splitString;
|
||||||
|
inherit (lib.attrsets) mapCartesianProduct;
|
||||||
|
inherit (lib.lists) intersectLists;
|
||||||
inherit (lib.trivial) boolToString warnIf;
|
inherit (lib.trivial) boolToString warnIf;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
in {
|
in {
|
||||||
|
@ -217,6 +219,46 @@ in {
|
||||||
'';
|
'';
|
||||||
styles = ["dark" "light" "dark_dimmed" "dark_default" "light_default" "dark_high_contrast" "light_high_contrast" "dark_colorblind" "light_colorblind" "dark_tritanopia" "light_tritanopia"];
|
styles = ["dark" "light" "dark_dimmed" "dark_default" "light_default" "dark_high_contrast" "light_high_contrast" "dark_colorblind" "light_colorblind" "dark_tritanopia" "light_tritanopia"];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
solarized = let
|
||||||
|
backgrounds = ["light" "dark"];
|
||||||
|
palettes = ["solarized" "selenized"];
|
||||||
|
variants = ["spring" "summer" "autumn" "winter"];
|
||||||
|
in {
|
||||||
|
setup = {
|
||||||
|
style ? "", # use plugin defaults
|
||||||
|
transparent ? false,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
parts = splitString "-" style;
|
||||||
|
detect = list:
|
||||||
|
let intersection = intersectLists parts list;
|
||||||
|
in if intersection == [] then null else builtins.head intersection;
|
||||||
|
background = detect backgrounds;
|
||||||
|
palette = detect palettes;
|
||||||
|
variant = detect variants;
|
||||||
|
in ''
|
||||||
|
-- Solarized theme
|
||||||
|
require('solarized').setup {
|
||||||
|
transparent = {
|
||||||
|
enabled = ${boolToString transparent},
|
||||||
|
},
|
||||||
|
${optionalString (!isNull palette) ''palette = "${palette}",''}
|
||||||
|
${optionalString (!isNull variant) ''variant = "${variant}",''}
|
||||||
|
}
|
||||||
|
${optionalString (!isNull background) ''vim.opt.background = "${background}"''}
|
||||||
|
vim.cmd.colorscheme "solarized"
|
||||||
|
'';
|
||||||
|
styles = let
|
||||||
|
joinWithDashes = parts: lib.concatStringsSep "-" (lib.filter (s: s != "") parts);
|
||||||
|
combinations = mapCartesianProduct ({bg, pal, var}: joinWithDashes [bg pal var]) {
|
||||||
|
bg = [""] ++ backgrounds;
|
||||||
|
pal = [""] ++ palettes;
|
||||||
|
var = [""] ++ variants;
|
||||||
|
};
|
||||||
|
in lib.filter (s: s != "") combinations;
|
||||||
|
};
|
||||||
|
|
||||||
solarized-osaka = {
|
solarized-osaka = {
|
||||||
setup = {transparent ? false, ...}: ''
|
setup = {transparent ? false, ...}: ''
|
||||||
require("solarized-osaka").setup({
|
require("solarized-osaka").setup({
|
||||||
|
|
|
@ -2261,6 +2261,22 @@
|
||||||
"url": "https://api.github.com/repos/folke/snacks.nvim/tarball/v2.22.0",
|
"url": "https://api.github.com/repos/folke/snacks.nvim/tarball/v2.22.0",
|
||||||
"hash": "1hbm4fnw51qdp0nz83fcxbvnxjq2k57a37w6dp0wz6wkcx7cwxw9"
|
"hash": "1hbm4fnw51qdp0nz83fcxbvnxjq2k57a37w6dp0wz6wkcx7cwxw9"
|
||||||
},
|
},
|
||||||
|
"solarized": {
|
||||||
|
"type": "GitRelease",
|
||||||
|
"repository": {
|
||||||
|
"type": "GitHub",
|
||||||
|
"owner": "maxmx03",
|
||||||
|
"repo": "solarized.nvim"
|
||||||
|
},
|
||||||
|
"pre_releases": false,
|
||||||
|
"version_upper_bound": null,
|
||||||
|
"release_prefix": null,
|
||||||
|
"submodules": false,
|
||||||
|
"version": "v3.6.0",
|
||||||
|
"revision": "c0dfe1cbfabd93b546baf5f1408f5df7e02e2050",
|
||||||
|
"url": "https://api.github.com/repos/maxmx03/solarized.nvim/tarball/v3.6.0",
|
||||||
|
"hash": "1fz1wc569w26aanmj3hhsc17xrx29g6bfsjsbgssa7jq76aavp3w"
|
||||||
|
},
|
||||||
"solarized-osaka": {
|
"solarized-osaka": {
|
||||||
"type": "Git",
|
"type": "Git",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue