nix-community.nixvim/plugins/colorschemes/vscode.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

41 lines
1.3 KiB
Nix
Raw Permalink Normal View History

2024-03-14 14:55:40 +01:00
{
lib,
...
}:
let
inherit (lib.nixvim) defaultNullOpts toLuaObject;
in
2024-12-22 09:58:27 +00:00
lib.nixvim.plugins.mkNeovimPlugin {
2024-03-14 14:55:40 +01:00
name = "vscode";
isColorscheme = true;
packPathName = "vscode-nvim";
package = "vscode-nvim";
2024-03-14 14:55:40 +01:00
colorscheme = null; # Color scheme is set by `require.("vscode").load()`
callSetup = false;
2024-08-22 10:03:02 -05:00
maintainers = [ lib.maintainers.loicreynier ];
2024-03-14 14:55:40 +01:00
settingsOptions = {
transparent = defaultNullOpts.mkBool false "Whether to enable transparent background";
italic_comments = defaultNullOpts.mkBool false "Whether to enable italic comments";
underline_links = defaultNullOpts.mkBool false "Whether to underline links";
disable_nvimtree_bg = defaultNullOpts.mkBool true "Whether to disable nvim-tree background";
2024-08-22 10:03:02 -05:00
color_overrides = defaultNullOpts.mkAttrsOf lib.types.str { } ''
2024-03-14 14:55:40 +01:00
A dictionary of color overrides.
See https://github.com/Mofiqul/vscode.nvim/blob/main/lua/vscode/colors.lua for color names.
'';
2024-08-22 10:03:02 -05:00
group_overrides = defaultNullOpts.mkAttrsOf lib.types.highlight { } ''
A dictionary of group names, each associated with a dictionary of parameters
(`bg`, `fg`, `sp` and `style`) and colors in hex.
'';
2024-03-14 14:55:40 +01:00
};
2024-05-05 19:39:35 +02:00
2024-03-14 14:55:40 +01:00
extraConfig = cfg: {
colorschemes.vscode.luaConfig.content = ''
2024-03-14 14:55:40 +01:00
local _vscode = require("vscode")
_vscode.setup(${toLuaObject cfg.settings})
2024-03-14 14:55:40 +01:00
_vscode.load()
2024-05-05 19:39:35 +02:00
'';
};
2024-03-14 14:55:40 +01:00
}