mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-23 13:50:44 +00:00
a452a0b0e7
mkEnableOption already adds the phrase "Whether to enable ..." to the beginning of the option description, such that the string argument should only be "thing to be enabled"
45 lines
1.3 KiB
Nix
45 lines
1.3 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
inherit (lib) mkOption mkEnableOption types;
|
|
|
|
cfg = config.vim.ui.borders;
|
|
|
|
defaultStyles = ["none" "single" "double" "rounded"];
|
|
in {
|
|
options.vim.ui.borders = {
|
|
enable = mkEnableOption "visible borders for most windows";
|
|
|
|
globalStyle = mkOption {
|
|
type = types.enum defaultStyles;
|
|
default = "rounded";
|
|
description = ''
|
|
global border style to use
|
|
'';
|
|
};
|
|
|
|
# TODO: make per-plugin borders configurable
|
|
plugins = let
|
|
mkPluginStyleOption = name: {
|
|
enable = mkEnableOption "borders for the ${name} plugin" // {default = cfg.enable;};
|
|
|
|
style = mkOption {
|
|
type = types.enum (defaultStyles ++ lib.optionals (name != "which-key") ["shadow"]);
|
|
default = cfg.globalStyle;
|
|
description = "border style to use for the ${name} plugin";
|
|
};
|
|
};
|
|
in {
|
|
# despite not having it listed in example configuration, which-key does support the rounded type
|
|
# additionall, it supports a "shadow" type that is similar to none but is of higher contrast
|
|
which-key = mkPluginStyleOption "which-key";
|
|
lspsaga = mkPluginStyleOption "lspsaga";
|
|
nvim-cmp = mkPluginStyleOption "nvim-cmp";
|
|
lsp-signature = mkPluginStyleOption "lsp-signature";
|
|
code-action-menu = mkPluginStyleOption "code-actions-menu";
|
|
};
|
|
};
|
|
}
|