2023-07-26 09:27:57 +02:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
2024-03-16 14:25:30 +01:00
|
|
|
inherit (lib.options) mkOption mkEnableOption;
|
2024-05-01 20:46:42 +02:00
|
|
|
inherit (lib.attrsets) mapAttrs;
|
2024-03-24 01:14:39 +01:00
|
|
|
inherit (lib.lists) optionals;
|
2024-03-16 14:25:30 +01:00
|
|
|
inherit (lib.types) enum;
|
2023-07-26 09:27:57 +02:00
|
|
|
|
|
|
|
cfg = config.vim.ui.borders;
|
|
|
|
|
2024-05-17 18:03:05 +02:00
|
|
|
# See `:h nvim_open_win` for the available border styles
|
|
|
|
# this list can be updated if additional styles are added.
|
|
|
|
defaultStyles = ["none" "single" "double" "rounded" "solid" "shadow"];
|
2023-07-23 17:26:38 +02:00
|
|
|
in {
|
|
|
|
options.vim.ui.borders = {
|
2024-05-17 18:03:05 +02:00
|
|
|
enable = mkEnableOption "visible borders for windows that support configurable borders";
|
2023-07-26 09:27:57 +02:00
|
|
|
|
2024-05-17 18:03:05 +02:00
|
|
|
# TODO: support configurable border elements with a lua table converted from a list of str
|
|
|
|
# e.g. [ "╔" "═" "╗" "║" "╝" "═" "╚" "║" ]
|
2023-07-26 09:27:57 +02:00
|
|
|
globalStyle = mkOption {
|
2024-03-16 14:25:30 +01:00
|
|
|
type = enum defaultStyles;
|
2024-05-17 18:03:05 +02:00
|
|
|
default = "single";
|
2023-07-26 09:27:57 +02:00
|
|
|
description = ''
|
2024-03-15 13:01:46 +01:00
|
|
|
The global border style to use.
|
2023-07-26 09:27:57 +02:00
|
|
|
'';
|
2023-07-25 21:16:20 +02:00
|
|
|
};
|
2023-07-23 17:26:38 +02:00
|
|
|
|
2023-07-26 09:27:57 +02:00
|
|
|
plugins = let
|
|
|
|
mkPluginStyleOption = name: {
|
2023-10-21 19:15:36 +02:00
|
|
|
enable = mkEnableOption "borders for the ${name} plugin" // {default = cfg.enable;};
|
2023-07-26 09:27:57 +02:00
|
|
|
|
|
|
|
style = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = enum (defaultStyles ++ optionals (name != "which-key") ["shadow"]);
|
2023-07-26 09:27:57 +02:00
|
|
|
default = cfg.globalStyle;
|
2024-03-16 14:25:30 +01:00
|
|
|
description = "The border style to use for the ${name} plugin";
|
2023-07-26 09:27:57 +02:00
|
|
|
};
|
|
|
|
};
|
2024-05-01 20:46:42 +02: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
|
2024-05-17 18:03:05 +02:00
|
|
|
which-key = "which-key";
|
|
|
|
lspsaga = "lspsaga";
|
|
|
|
nvim-cmp = "nvim-cmp";
|
|
|
|
lsp-signature = "lsp-signature";
|
|
|
|
code-action-menu = "code-actions-menu";
|
2024-05-01 20:46:42 +02:00
|
|
|
};
|
2023-07-23 17:26:38 +02:00
|
|
|
};
|
|
|
|
}
|