2023-07-26 07:27:57 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
2024-03-16 13:25:30 +00:00
|
|
|
inherit (lib.options) mkOption mkEnableOption;
|
2024-05-01 18:46:42 +00:00
|
|
|
inherit (lib.attrsets) mapAttrs;
|
2024-03-24 00:14:39 +00:00
|
|
|
inherit (lib.lists) optionals;
|
2024-03-16 13:25:30 +00:00
|
|
|
inherit (lib.types) enum;
|
2023-07-26 07:27:57 +00:00
|
|
|
|
|
|
|
cfg = config.vim.ui.borders;
|
|
|
|
|
|
|
|
defaultStyles = ["none" "single" "double" "rounded"];
|
2023-07-23 15:26:38 +00:00
|
|
|
in {
|
|
|
|
options.vim.ui.borders = {
|
2023-07-26 07:27:57 +00:00
|
|
|
enable = mkEnableOption "visible borders for most windows";
|
|
|
|
|
|
|
|
globalStyle = mkOption {
|
2024-03-16 13:25:30 +00:00
|
|
|
type = enum defaultStyles;
|
2023-07-26 07:27:57 +00:00
|
|
|
default = "rounded";
|
|
|
|
description = ''
|
2024-03-15 12:01:46 +00:00
|
|
|
The global border style to use.
|
2023-07-26 07:27:57 +00:00
|
|
|
'';
|
2023-07-25 19:16:20 +00:00
|
|
|
};
|
2023-07-23 15:26:38 +00:00
|
|
|
|
2023-07-26 07:27:57 +00:00
|
|
|
plugins = let
|
|
|
|
mkPluginStyleOption = name: {
|
2023-10-21 17:15:36 +00:00
|
|
|
enable = mkEnableOption "borders for the ${name} plugin" // {default = cfg.enable;};
|
2023-07-26 07:27:57 +00:00
|
|
|
|
|
|
|
style = mkOption {
|
2024-03-24 00:14:39 +00:00
|
|
|
type = enum (defaultStyles ++ optionals (name != "which-key") ["shadow"]);
|
2023-07-26 07:27:57 +00:00
|
|
|
default = cfg.globalStyle;
|
2024-03-16 13:25:30 +00:00
|
|
|
description = "The border style to use for the ${name} plugin";
|
2023-07-26 07:27:57 +00:00
|
|
|
};
|
|
|
|
};
|
2024-05-01 18:46:42 +00:00
|
|
|
in
|
|
|
|
mapAttrs (_: mkPluginStyleOption) {
|
|
|
|
# despite not having it listed in example configuration, which-key does support the rounded type
|
|
|
|
# additionally, 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";
|
|
|
|
};
|
2023-07-23 15:26:38 +00:00
|
|
|
};
|
|
|
|
}
|