Compare commits

..

No commits in common. "b9dcbec29cce992f35328468ed521bd095c734c9" and "b347757f8a1acec4c53f5811bf8af70de5c06129" have entirely different histories.

10 changed files with 24 additions and 30 deletions

View file

@ -1,7 +1,7 @@
# Custom Plugins {#ch-custom-plugins}
**nvf**, by default, exposes a wide variety of plugins as module options
for your convenience and bundles necessary dependencies into **nvf**'s runtime.
for your convience and bundles necessary dependencies into **nvf**'s runtime.
In case a plugin is not available in **nvf**, you may consider making a pull
request to **nvf** to include it as a module or you may add it to your
configuration locally.

View file

@ -53,7 +53,6 @@ configuration formats.
longer filtered and thus should be used instead.
- Add dap-go for better dap configurations
- Make noice.nvim customizable
- Standardize border style options and add custom borders
[rust-tools.nvim]: https://github.com/simrat39/rust-tools.nvim
[rustaceanvim]: https://github.com/mrcjkb/rustaceanvim

View file

@ -9,7 +9,7 @@
typesCustom = import ./custom.nix {inherit lib;};
in {
inherit (typesDag) dagOf;
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType borderType;
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType;
inherit (typesLanguage) diagnostics mkGrammarOption;
inherit (typesCustom) anythingConcatLists char;
}

View file

@ -51,13 +51,9 @@
};
};
};
borderPresets = ["none" "single" "double" "rounded" "solid" "shadow"];
in {
inherit extraPluginType fromInputs pluginType;
borderType = either (enum borderPresets) (listOf (either str (listOf str)));
pluginsOpt = {
description,
example,

View file

@ -7,7 +7,6 @@
inherit (lib.strings) optionalString;
inherit (lib.attrsets) mapAttrs;
inherit (lib.nvim.dag) entryAfter;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.lsp;
in {
@ -23,7 +22,7 @@ in {
${
optionalString config.vim.ui.borders.enable ''
require('lspconfig.ui.windows').default_options.border = ${toLuaObject config.vim.ui.borders.globalStyle}
require('lspconfig.ui.windows').default_options.border = '${config.vim.ui.borders.globalStyle}'
''
}
'';

View file

@ -6,7 +6,6 @@
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.binds) mkSetBinding addDescriptionsToMappings pushDownDefault;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.lsp;
@ -26,7 +25,7 @@ in {
pluginRC.code-action-menu = entryAnywhere ''
-- border configuration
vim.g.code_action_menu_window_border = ${toLuaObject config.vim.ui.borders.plugins.code-action-menu.style}
vim.g.code_action_menu_window_border = '${config.vim.ui.borders.plugins.code-action-menu.style}'
-- show individual sections of the code action menu
${lib.optionalString cfg.nvimCodeActionMenu.show.details "vim.g.code_action_menu_show_details = true"}

View file

@ -4,34 +4,31 @@
...
}: let
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.nvim.types) borderType;
inherit (lib.lists) optionals;
inherit (lib.types) enum;
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 = borderType;
type = enum defaultStyles;
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 = borderType;
type = enum (defaultStyles ++ optionals (name != "which-key") ["shadow"]);
default = cfg.globalStyle;
description = "The border style to use for the ${name} plugin";
};

View file

@ -4,9 +4,9 @@
...
}: let
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) nullOr listOf enum bool str int either;
inherit (lib.types) nullOr listOf enum bool str int;
inherit (lib.modules) mkRenamedOptionModule;
inherit (lib.nvim.types) mkPluginSetupOption borderType;
inherit (lib.nvim.types) mkPluginSetupOption;
mkSimpleIconOption = default:
mkOption {
inherit default;
@ -212,7 +212,8 @@ in {
# position = {}
border = mkOption {
type = borderType;
# TODO: let this type accept a custom string
type = enum ["single" "rounded" "double" "solid" "none"];
default = config.vim.ui.borders.globalStyle;
description = "border style to use";
};
@ -235,7 +236,8 @@ in {
*/
border = mkOption {
type = borderType;
# TODO: let this type accept a custom string
type = nullOr (enum ["single" "rounded" "double" "solid" "none"]);
default = config.vim.ui.borders.globalStyle;
description = "border style to use for the left section of Navbuddy UI";
};
@ -252,7 +254,8 @@ in {
*/
border = mkOption {
type = borderType;
# TODO: let this type accept a custom string
type = nullOr (enum ["single" "rounded" "double" "solid" "none"]);
default = config.vim.ui.borders.globalStyle;
description = "border style to use for the middle section of Navbuddy UI";
};
@ -262,7 +265,8 @@ in {
# there is no size option for the right section, it fills the remaining space
right = {
border = mkOption {
type = borderType;
# TODO: let this type accept a custom string
type = nullOr (enum ["single" "rounded" "double" "solid" "none"]);
default = config.vim.ui.borders.globalStyle;
description = "border style to use for the right section of Navbuddy UI";
};

View file

@ -25,7 +25,7 @@ in {
${optionalString config.vim.ui.borders.plugins.which-key.enable ''
window = {
border = ${toLuaObject config.vim.ui.borders.plugins.which-key.style},
border = "${config.vim.ui.borders.plugins.which-key.style}",
},
''}
})

View file

@ -7,7 +7,7 @@
inherit (lib.options) mkEnableOption mkOption literalExpression;
inherit (lib.strings) toUpper;
inherit (lib.types) int float bool str enum listOf attrsOf oneOf nullOr submodule;
inherit (lib.nvim.types) mkPluginSetupOption luaInline borderType;
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
inherit (lib.generators) mkLuaInline;
in {
imports = [
@ -453,7 +453,7 @@ in {
};
border = mkOption {
description = "Border style of the notification window";
type = borderType;
type = enum ["none" "single" "double" "rounded" "solid" "shadow"];
default =
if config.vim.ui.borders.enable
then config.vim.ui.borders.globalStyle