mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 02:11:33 +00:00
feat: per-plugin border styles
defaults to the value of globalStyle, can be overriden
This commit is contained in:
parent
0667f1f936
commit
cc1f1b2ed8
7 changed files with 59 additions and 11 deletions
|
@ -1,13 +1,43 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib) mkEnableOption mkOption types;
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkOption mkEnableOption types;
|
||||
|
||||
cfg = config.vim.ui.borders;
|
||||
|
||||
defaultStyles = ["none" "single" "double" "rounded"];
|
||||
in {
|
||||
options.vim.ui.borders = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "visible borders for most windows";
|
||||
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 "whether to enable 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";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue