plugins/vscode: init (#1263)

This commit is contained in:
Loïc Reynier 2024-03-14 14:55:40 +01:00 committed by GitHub
parent 9b9912077e
commit bb10fface4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 64 additions and 0 deletions

View file

@ -0,0 +1,47 @@
{
lib,
helpers,
config,
pkgs,
...
}:
with lib;
helpers.neovim-plugin.mkNeovimPlugin config {
name = "vscode";
isColorscheme = true;
originalName = "vscode-nvim";
defaultPackage = pkgs.vimPlugins.vscode-nvim;
colorscheme = null; # Color scheme is set by `require.("vscode").load()`
callSetup = false;
maintainers = [maintainers.loicreynier];
settingsOptions = {
transparent = helpers.defaultNullOpts.mkBool false "Whether to enable transparent background";
italic_comments = helpers.defaultNullOpts.mkBool false "Whether to enable italic comments";
underline_links = helpers.defaultNullOpts.mkBool false "Whether to underline links";
disable_nvimtree_bg = helpers.defaultNullOpts.mkBool true "Whether to disable nvim-tree background";
color_overrides =
helpers.defaultNullOpts.mkAttrsOf types.str
"{}"
''
A dictionary of color overrides.
See https://github.com/Mofiqul/vscode.nvim/blob/main/lua/vscode/colors.lua for color names.
'';
group_overrides = with helpers;
defaultNullOpts.mkAttrsOf nixvimTypes.highlight
"{}"
''
A dictionary of group names, each associated with a dictionary of parameters
(`bg`, `fg`, `sp` and `style`) and colors in hex.
'';
};
extraConfig = cfg: {
extraConfigLuaPre = ''
local _vscode = require("vscode")
_vscode.setup(${helpers.toLuaObject cfg.settings})
_vscode.load()
'';
};
}

View file

@ -20,6 +20,7 @@
./colorschemes/poimandres.nix ./colorschemes/poimandres.nix
./colorschemes/rose-pine.nix ./colorschemes/rose-pine.nix
./colorschemes/tokyonight.nix ./colorschemes/tokyonight.nix
./colorschemes/vscode.nix
./completion/codeium-vim.nix ./completion/codeium-vim.nix
./completion/copilot-lua.nix ./completion/copilot-lua.nix

View file

@ -0,0 +1,16 @@
{
empty = {
colorschemes.vscode.enable = true;
};
defaults = {
colorschemes.vscode = {
enable = true;
settings = {
transparent = true;
italic_comments = true;
underline_links = true;
};
};
};
}