neovim-flake/modules/plugins/ui/borders/borders.nix
Ching Pei Yang b499151527
treewide: standardize border type (#341)
* ui: allow custom listOf str border type

* lib: extract shared borderType

* remove TODO

* allow ["|" "HighlightGroup"] for border char

* docs: update rl notes

---------

Co-authored-by: raf <raf@notashelf.dev>
2024-09-13 19:34:21 +03:00

49 lines
1.6 KiB
Nix

{
config,
lib,
...
}: let
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.nvim.types) borderType;
cfg = config.vim.ui.borders;
in {
options.vim.ui.borders = {
enable = mkEnableOption "visible borders for most windows";
globalStyle = mkOption {
type = borderType;
default = "rounded";
description = ''
The global border style to use.
If a list is given, it should have a length of eight or any divisor of
eight. The array will specify the eight chars building up the border in
a clockwise fashion starting with the top-left corner. You can specify
a different highlight group for each character by passing a
[char, "YourHighlightGroup"] instead
'';
example = ["" "" "" "" "" "" "" ""];
};
plugins = let
mkPluginStyleOption = name: {
enable = mkEnableOption "borders for the ${name} plugin" // {default = cfg.enable;};
style = mkOption {
type = borderType;
default = cfg.globalStyle;
description = "The border style to use for the ${name} plugin";
};
};
in {
# 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";
};
};
}