mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-26 18:58:43 +02:00
colorschemes/onedark: switch to onedark.nvim + tests
This commit is contained in:
parent
303b9ca2c0
commit
0ee062ed74
2 changed files with 106 additions and 14 deletions
|
@ -5,23 +5,42 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
helpers.neovim-plugin.mkNeovimPlugin config {
|
||||||
cfg = config.colorschemes.onedark;
|
name = "onedark";
|
||||||
in {
|
isColorscheme = true;
|
||||||
options = {
|
originalName = "onedark.nvim";
|
||||||
colorschemes.onedark = {
|
defaultPackage = pkgs.vimPlugins.onedark-nvim;
|
||||||
enable = mkEnableOption "onedark";
|
|
||||||
|
|
||||||
package = helpers.mkPackageOption "one" pkgs.vimPlugins.onedark-vim;
|
maintainers = [lib.maintainers.GaetanLepage];
|
||||||
|
|
||||||
|
settingsExample = {
|
||||||
|
colors = {
|
||||||
|
bright_orange = "#ff8800";
|
||||||
|
green = "#00ffaa";
|
||||||
|
};
|
||||||
|
highlights = {
|
||||||
|
"@keyword".fg = "$green";
|
||||||
|
"@string" = {
|
||||||
|
fg = "$bright_orange";
|
||||||
|
bg = "#00ff00";
|
||||||
|
fmt = "bold";
|
||||||
|
};
|
||||||
|
"@function" = {
|
||||||
|
fg = "#0000ff";
|
||||||
|
sp = "$cyan";
|
||||||
|
fmt = "underline,italic";
|
||||||
|
};
|
||||||
|
"@function.builtin".fg = "#0059ff";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
callSetup = false;
|
||||||
colorscheme = "onedark";
|
colorscheme = null;
|
||||||
extraPlugins = [cfg.package];
|
extraConfig = cfg: {
|
||||||
|
extraConfigLuaPre = ''
|
||||||
options = {
|
_onedark = require('onedark')
|
||||||
termguicolors = true;
|
_onedark.setup(${helpers.toLuaObject cfg.settings})
|
||||||
};
|
_onedark.load()
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
73
tests/test-sources/plugins/colorschemes/onedark.nix
Normal file
73
tests/test-sources/plugins/colorschemes/onedark.nix
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
{
|
||||||
|
empty = {
|
||||||
|
colorschemes.onedark.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
example = {
|
||||||
|
colorschemes.onedark = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
colors = {
|
||||||
|
bright_orange = "#ff8800";
|
||||||
|
green = "#00ffaa";
|
||||||
|
};
|
||||||
|
highlights = {
|
||||||
|
"@keyword".fg = "$green";
|
||||||
|
"@string" = {
|
||||||
|
fg = "$bright_orange";
|
||||||
|
bg = "#00ff00";
|
||||||
|
fmt = "bold";
|
||||||
|
};
|
||||||
|
"@function" = {
|
||||||
|
fg = "#0000ff";
|
||||||
|
sp = "$cyan";
|
||||||
|
fmt = "underline,italic";
|
||||||
|
};
|
||||||
|
"@function.builtin".fg = "#0059ff";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
defaults = {
|
||||||
|
colorschemes.onedark = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
style = "dark";
|
||||||
|
transparent = false;
|
||||||
|
term_colors = true;
|
||||||
|
ending_tildes = false;
|
||||||
|
cmp_itemkind_reverse = false;
|
||||||
|
toggle_style_key = null;
|
||||||
|
toggle_style_list = [
|
||||||
|
"dark"
|
||||||
|
"darker"
|
||||||
|
"cool"
|
||||||
|
"deep"
|
||||||
|
"warm"
|
||||||
|
"warmer"
|
||||||
|
"light"
|
||||||
|
];
|
||||||
|
code_style = {
|
||||||
|
comments = "italic";
|
||||||
|
keywords = "none";
|
||||||
|
functions = "none";
|
||||||
|
strings = "none";
|
||||||
|
variables = "none";
|
||||||
|
};
|
||||||
|
lualine = {
|
||||||
|
transparent = false;
|
||||||
|
};
|
||||||
|
colors = {};
|
||||||
|
highlights = {};
|
||||||
|
diagnostics = {
|
||||||
|
darker = true;
|
||||||
|
undercurl = true;
|
||||||
|
background = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue