mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 18:31:35 +00:00
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>
This commit is contained in:
parent
b347757f8a
commit
b499151527
9 changed files with 29 additions and 23 deletions
|
@ -4,31 +4,34 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.lists) optionals;
|
||||
inherit (lib.types) enum;
|
||||
inherit (lib.nvim.types) borderType;
|
||||
|
||||
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 = enum defaultStyles;
|
||||
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 = ["╔" "═" "╗" "║" "╝" "═" "╚" "║"];
|
||||
};
|
||||
|
||||
# TODO: make per-plugin borders configurable
|
||||
plugins = let
|
||||
mkPluginStyleOption = name: {
|
||||
enable = mkEnableOption "borders for the ${name} plugin" // {default = cfg.enable;};
|
||||
|
||||
style = mkOption {
|
||||
type = enum (defaultStyles ++ optionals (name != "which-key") ["shadow"]);
|
||||
type = borderType;
|
||||
default = cfg.globalStyle;
|
||||
description = "The border style to use for the ${name} plugin";
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue