mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-12-13 07:31:02 +00:00
Merge 7497ce651f into 43b48909a3
This commit is contained in:
commit
9a99e39f8a
2 changed files with 320 additions and 198 deletions
|
|
@ -5,115 +5,98 @@
|
|||
inherit (lib.strings) optionalString splitString;
|
||||
inherit (lib.attrsets) mapCartesianProduct;
|
||||
inherit (lib.lists) intersectLists;
|
||||
inherit (lib.trivial) boolToString warnIf;
|
||||
inherit (lib.trivial) warnIf;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
in {
|
||||
# FIXME: those all need to be converted to setupOpts format
|
||||
# or else we explode...
|
||||
base16 = {
|
||||
setup = {base16-colors, ...}: ''
|
||||
setup = setupOpts: ''
|
||||
-- Base16 theme
|
||||
require('base16-colorscheme').setup(${toLuaObject base16-colors})
|
||||
require('base16-colorscheme').setup(${toLuaObject setupOpts})
|
||||
'';
|
||||
};
|
||||
|
||||
mini-base16 = {
|
||||
setup = {base16-colors, ...}: ''
|
||||
setup = setupOpts: ''
|
||||
-- Base16 theme
|
||||
require('mini.base16').setup({
|
||||
palette = ${toLuaObject base16-colors}
|
||||
palette = ${toLuaObject setupOpts}
|
||||
})
|
||||
'';
|
||||
};
|
||||
|
||||
onedark = {
|
||||
setup = {
|
||||
style ? "dark",
|
||||
transparent,
|
||||
...
|
||||
}: ''
|
||||
styles = ["dark" "darker" "cool" "deep" "warm" "warmer"];
|
||||
setup = setupOpts: ''
|
||||
-- OneDark theme
|
||||
require('onedark').setup {
|
||||
transparent = ${boolToString transparent},
|
||||
style = "${style}"
|
||||
}
|
||||
require('onedark').setup(${toLuaObject setupOpts})
|
||||
require('onedark').load()
|
||||
'';
|
||||
styles = ["dark" "darker" "cool" "deep" "warm" "warmer"];
|
||||
};
|
||||
|
||||
tokyonight = {
|
||||
setup = {
|
||||
style ? "night",
|
||||
transparent,
|
||||
...
|
||||
}: ''
|
||||
require('tokyonight').setup {
|
||||
transparent = ${boolToString transparent};
|
||||
styles = {
|
||||
sidebars = ${
|
||||
if transparent
|
||||
then ''"transparent"''
|
||||
else ''"dark"''
|
||||
},
|
||||
floats = ${
|
||||
if transparent
|
||||
then ''"transparent"''
|
||||
else ''"dark"''
|
||||
},
|
||||
},
|
||||
}
|
||||
vim.cmd[[colorscheme tokyonight-${style}]]
|
||||
'';
|
||||
styles = ["day" "night" "storm" "moon"];
|
||||
setup = setupOpts: ''
|
||||
require('tokyonight').setup(${toLuaObject setupOpts})
|
||||
vim.cmd[[colorscheme tokyonight-${setupOpts.style or "night"}]]
|
||||
'';
|
||||
};
|
||||
|
||||
dracula = {
|
||||
setup = {transparent, ...}: ''
|
||||
require('dracula').setup({
|
||||
transparent_bg = ${boolToString transparent},
|
||||
});
|
||||
setup = setupOpts: let
|
||||
cleanedOpts =
|
||||
(removeAttrs setupOpts ["transparent"])
|
||||
// {
|
||||
transparent_bg = setupOpts.transparent or false;
|
||||
};
|
||||
in ''
|
||||
require('dracula').setup(${toLuaObject cleanedOpts});
|
||||
require('dracula').load();
|
||||
'';
|
||||
};
|
||||
|
||||
catppuccin = {
|
||||
setup = {
|
||||
style ? "mocha",
|
||||
transparent ? false,
|
||||
...
|
||||
}: ''
|
||||
-- Catppuccin theme
|
||||
require('catppuccin').setup {
|
||||
flavour = "${style}",
|
||||
transparent_background = ${boolToString transparent},
|
||||
float = {
|
||||
transparent = ${boolToString transparent},
|
||||
},
|
||||
term_colors = true,
|
||||
integrations = {
|
||||
nvimtree = {
|
||||
enabled = true,
|
||||
transparent_panel = ${boolToString transparent},
|
||||
show_root = true,
|
||||
},
|
||||
setup = setupOpts: let
|
||||
cleanedOpts =
|
||||
(removeAttrs setupOpts ["style" "transparent"])
|
||||
// {
|
||||
flavour = setupOpts.style or "mocha";
|
||||
transparent_background = setupOpts.transparent or false;
|
||||
float = {
|
||||
transparent = setupOpts.transparent or false;
|
||||
};
|
||||
term_colors = true;
|
||||
integrations = {
|
||||
nvimtree = {
|
||||
enabled = true;
|
||||
transparent_panel = setupOpts.transparent or false;
|
||||
show_root = true;
|
||||
};
|
||||
|
||||
hop = true,
|
||||
gitsigns = true,
|
||||
telescope = true,
|
||||
treesitter = true,
|
||||
treesitter_context = true,
|
||||
ts_rainbow = true,
|
||||
fidget = true,
|
||||
alpha = true,
|
||||
leap = true,
|
||||
lsp_saga = true,
|
||||
markdown = true,
|
||||
noice = true,
|
||||
notify = true, -- nvim-notify
|
||||
which_key = true,
|
||||
navic = {
|
||||
enabled = true,
|
||||
custom_bg = "NONE", -- "lualine" will set background to mantle
|
||||
},
|
||||
},
|
||||
}
|
||||
hop = true;
|
||||
gitsigns = true;
|
||||
telescope = true;
|
||||
treesitter = true;
|
||||
treesitter_context = true;
|
||||
ts_rainbow = true;
|
||||
fidget = true;
|
||||
alpha = true;
|
||||
leap = true;
|
||||
lsp_saga = true;
|
||||
markdown = true;
|
||||
noice = true;
|
||||
notify = true; # nvim-notify
|
||||
which_key = true;
|
||||
navic = {
|
||||
enabled = true;
|
||||
custom_bg = "NONE"; # "lualine" will set background to mantle
|
||||
};
|
||||
};
|
||||
};
|
||||
in ''
|
||||
-- Catppuccin theme
|
||||
require('catppuccin').setup(${toLuaObject cleanedOpts})
|
||||
-- setup must be called before loading
|
||||
vim.cmd.colorscheme "catppuccin"
|
||||
'';
|
||||
|
|
@ -121,17 +104,14 @@ in {
|
|||
};
|
||||
|
||||
oxocarbon = {
|
||||
setup = {
|
||||
style ? "dark",
|
||||
transparent ? false,
|
||||
...
|
||||
}: let
|
||||
style' =
|
||||
warnIf (style == "light") "oxocarbon: light theme is not well-supported" style;
|
||||
setup = setupOpts: let
|
||||
style = setupOpts.style or "dark";
|
||||
style' = warnIf (style == "light") "oxocarbon: light theme is not well-supported" style;
|
||||
transparent = setupOpts.transparent or false;
|
||||
in ''
|
||||
require('oxocarbon')
|
||||
vim.opt.background = "${style'}"
|
||||
vim.cmd.colorscheme = "oxocarbon"
|
||||
vim.cmd.colorscheme "oxocarbon"
|
||||
${optionalString transparent ''
|
||||
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
|
||||
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
|
||||
|
|
@ -146,93 +126,99 @@ in {
|
|||
};
|
||||
|
||||
gruvbox = {
|
||||
setup = {
|
||||
style ? "dark",
|
||||
transparent ? false,
|
||||
...
|
||||
}: ''
|
||||
setup = setupOpts: let
|
||||
cleanedOpts =
|
||||
(removeAttrs setupOpts ["transparent" "style"])
|
||||
// {
|
||||
terminal_colors = true; # add neovim terminal colors
|
||||
undercurl = true;
|
||||
underline = true;
|
||||
bold = true;
|
||||
italic = {
|
||||
strings = true;
|
||||
emphasis = true;
|
||||
comments = true;
|
||||
operators = false;
|
||||
folds = true;
|
||||
};
|
||||
strikethrough = true;
|
||||
invert_selection = false;
|
||||
invert_signs = false;
|
||||
invert_tabline = false;
|
||||
invert_intend_guides = false;
|
||||
inverse = true;
|
||||
contrast = "";
|
||||
palette_overrides = {};
|
||||
overrides = {};
|
||||
dim_inactive = false;
|
||||
transparent_mode = setupOpts.transparent or false;
|
||||
};
|
||||
style = setupOpts.style or "dark";
|
||||
in ''
|
||||
styles = ["dark" "light"];
|
||||
-- Gruvbox theme
|
||||
require("gruvbox").setup({
|
||||
terminal_colors = true, -- add neovim terminal colors
|
||||
undercurl = true,
|
||||
underline = true,
|
||||
bold = true,
|
||||
italic = {
|
||||
strings = true,
|
||||
emphasis = true,
|
||||
comments = true,
|
||||
operators = false,
|
||||
folds = true,
|
||||
},
|
||||
strikethrough = true,
|
||||
invert_selection = false,
|
||||
invert_signs = false,
|
||||
invert_tabline = false,
|
||||
invert_intend_guides = false,
|
||||
inverse = true,
|
||||
contrast = "",
|
||||
palette_overrides = {},
|
||||
overrides = {},
|
||||
dim_inactive = false,
|
||||
transparent_mode = ${boolToString transparent},
|
||||
})
|
||||
require("gruvbox").setup(${toLuaObject cleanedOpts})
|
||||
vim.o.background = "${style}"
|
||||
vim.cmd("colorscheme gruvbox")
|
||||
'';
|
||||
styles = ["dark" "light"];
|
||||
};
|
||||
|
||||
rose-pine = {
|
||||
setup = {
|
||||
style ? "main",
|
||||
transparent ? false,
|
||||
...
|
||||
}: ''
|
||||
require("rose-pine").setup({
|
||||
dark_variant = "${style}", -- main, moon, or dawn
|
||||
dim_inactive_windows = false,
|
||||
extend_background_behind_borders = true,
|
||||
setup = setupOpts: let
|
||||
cleanedOpts =
|
||||
(removeAttrs setupOpts ["style" "transparent"])
|
||||
// {
|
||||
dark_variant = setupOpts.style or "main"; # main, moon, or dawn
|
||||
dim_inactive_windows = false;
|
||||
extend_background_behind_borders = true;
|
||||
|
||||
enable = {
|
||||
terminal = true,
|
||||
migrations = true,
|
||||
},
|
||||
|
||||
styles = {
|
||||
bold = false,
|
||||
italic = false, -- I would like to add more options for this
|
||||
transparency = ${boolToString transparent},
|
||||
},
|
||||
})
|
||||
enable = {
|
||||
terminal = true;
|
||||
migrations = true;
|
||||
};
|
||||
|
||||
styles = {
|
||||
bold = false;
|
||||
italic = false; # I would like to add more options for this
|
||||
transparency = setupOpts.transparent or false;
|
||||
};
|
||||
};
|
||||
in ''
|
||||
require("rose-pine").setup(${toLuaObject cleanedOpts})
|
||||
vim.cmd("colorscheme rose-pine")
|
||||
'';
|
||||
styles = ["main" "moon" "dawn"];
|
||||
};
|
||||
nord = {
|
||||
setup = {transparent ? false, ...}: ''
|
||||
require("nord").setup({
|
||||
transparent = ${boolToString transparent},
|
||||
search = "vscode", -- [vim|vscode]
|
||||
})
|
||||
|
||||
nord = {
|
||||
setup = setupOpts: let
|
||||
cleanedOpts =
|
||||
(removeAttrs setupOpts ["transparent"])
|
||||
// {
|
||||
transparent = setupOpts.transparent or false;
|
||||
search = "vscode"; # [vim|vscode]
|
||||
};
|
||||
in ''
|
||||
require("nord").setup(${toLuaObject cleanedOpts})
|
||||
vim.cmd.colorscheme("nord")
|
||||
'';
|
||||
};
|
||||
github = {
|
||||
setup = {
|
||||
style ? "dark",
|
||||
transparent ? false,
|
||||
...
|
||||
}: ''
|
||||
require('github-theme').setup({
|
||||
options = {
|
||||
transparent = ${boolToString transparent},
|
||||
},
|
||||
})
|
||||
|
||||
github = {
|
||||
styles = ["dark" "light" "dark_dimmed" "dark_default" "light_default" "dark_high_contrast" "light_high_contrast" "dark_colorblind" "light_colorblind" "dark_tritanopia" "light_tritanopia"];
|
||||
setup = setupOpts: let
|
||||
cleanedOpts =
|
||||
(removeAttrs setupOpts ["transparent" "style"])
|
||||
// {
|
||||
options = {
|
||||
transparent = setupOpts.transparent or false;
|
||||
};
|
||||
};
|
||||
style = setupOpts.style or "dark";
|
||||
in ''
|
||||
require('github-theme').setup(${toLuaObject cleanedOpts})
|
||||
vim.cmd[[colorscheme github_${style}]]
|
||||
'';
|
||||
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
|
||||
|
|
@ -240,11 +226,8 @@ in {
|
|||
palettes = ["solarized" "selenized"];
|
||||
variants = ["spring" "summer" "autumn" "winter"];
|
||||
in {
|
||||
setup = {
|
||||
style ? "", # use plugin defaults
|
||||
transparent ? false,
|
||||
...
|
||||
}: let
|
||||
setup = setupOpts: let
|
||||
style = setupOpts.style or "";
|
||||
parts = splitString "-" style;
|
||||
detect = list: let
|
||||
intersection = intersectLists parts list;
|
||||
|
|
@ -255,15 +238,28 @@ in {
|
|||
background = detect backgrounds;
|
||||
palette = detect palettes;
|
||||
variant = detect variants;
|
||||
baseSetup =
|
||||
{
|
||||
transparent = {
|
||||
enabled = setupOpts.transparent or false;
|
||||
};
|
||||
}
|
||||
// (removeAttrs setupOpts ["style" "transparent"]);
|
||||
finalSetup =
|
||||
baseSetup
|
||||
// (
|
||||
if palette != null
|
||||
then {palette = palette;}
|
||||
else {}
|
||||
)
|
||||
// (
|
||||
if variant != null
|
||||
then {variant = variant;}
|
||||
else {}
|
||||
);
|
||||
in ''
|
||||
-- Solarized theme
|
||||
require('solarized').setup {
|
||||
transparent = {
|
||||
enabled = ${boolToString transparent},
|
||||
},
|
||||
${optionalString (palette != null) ''palette = "${palette}",''}
|
||||
${optionalString (variant != null) ''variant = "${variant}",''}
|
||||
}
|
||||
require('solarized').setup(${toLuaObject finalSetup})
|
||||
${optionalString (background != null) ''vim.opt.background = "${background}"''}
|
||||
vim.cmd.colorscheme "solarized"
|
||||
'';
|
||||
|
|
@ -284,25 +280,28 @@ in {
|
|||
};
|
||||
|
||||
solarized-osaka = {
|
||||
setup = {transparent ? false, ...}: ''
|
||||
require("solarized-osaka").setup({
|
||||
transparent = ${boolToString transparent},
|
||||
styles = {
|
||||
comments = { italic = false },
|
||||
keywords = { italic = false },
|
||||
}
|
||||
})
|
||||
|
||||
setup = setupOpts: let
|
||||
cleanedOpts =
|
||||
(removeAttrs setupOpts ["transparent"])
|
||||
// {
|
||||
transparent = setupOpts.transparent or false;
|
||||
styles = {
|
||||
comments = {italic = false;};
|
||||
keywords = {italic = false;};
|
||||
};
|
||||
};
|
||||
in ''
|
||||
require("solarized-osaka").setup(${toLuaObject cleanedOpts})
|
||||
vim.cmd.colorscheme("solarized-osaka")
|
||||
'';
|
||||
};
|
||||
|
||||
everforest = {
|
||||
setup = {
|
||||
style ? "medium",
|
||||
transparent ? false,
|
||||
...
|
||||
}: ''
|
||||
styles = ["hard" "medium" "soft"];
|
||||
setup = setupOpts: let
|
||||
style = setupOpts.style or "medium";
|
||||
transparent = setupOpts.transparent or false;
|
||||
in ''
|
||||
vim.g.everforest_background = "${style}"
|
||||
vim.g.everforest_transparent_background = ${
|
||||
if transparent
|
||||
|
|
@ -312,8 +311,6 @@ in {
|
|||
|
||||
vim.cmd.colorscheme("everforest")
|
||||
'';
|
||||
|
||||
styles = ["hard" "medium" "soft"];
|
||||
};
|
||||
|
||||
mellow = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue