From 0e84e4ebed49758f36d192397212cd21a06ad366 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Wed, 1 May 2024 21:46:42 +0300 Subject: [PATCH] modules/plugins: move plugins/ui to neovim/global/ui --- modules/modules.nix | 1 + modules/neovim/global/default.nix | 6 ++++++ .../borders => neovim/global/ui}/borders.nix | 21 ++++++++++--------- modules/plugins/ui/borders/default.nix | 5 ----- modules/plugins/ui/default.nix | 10 ++++----- 5 files changed, 22 insertions(+), 21 deletions(-) create mode 100644 modules/neovim/global/default.nix rename modules/{plugins/ui/borders => neovim/global/ui}/borders.nix (60%) delete mode 100644 modules/plugins/ui/borders/default.nix diff --git a/modules/modules.nix b/modules/modules.nix index a00cea6..2d82f87 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -10,6 +10,7 @@ # Contains configuration for core neovim features # such as spellchecking, mappings, and the init script (init.vim). neovim = map (p: ./neovim + "/${p}") [ + "global" "init" "mappings" ]; diff --git a/modules/neovim/global/default.nix b/modules/neovim/global/default.nix new file mode 100644 index 0000000..94b5788 --- /dev/null +++ b/modules/neovim/global/default.nix @@ -0,0 +1,6 @@ +{lib}: { + imports = lib.concatLists [ + # Configuration options for Neovim UI + (lib.filesystem.listFilesRecursive ./ui) + ]; +} diff --git a/modules/plugins/ui/borders/borders.nix b/modules/neovim/global/ui/borders.nix similarity index 60% rename from modules/plugins/ui/borders/borders.nix rename to modules/neovim/global/ui/borders.nix index 37589dc..7021301 100644 --- a/modules/plugins/ui/borders/borders.nix +++ b/modules/neovim/global/ui/borders.nix @@ -4,6 +4,7 @@ ... }: let inherit (lib.options) mkOption mkEnableOption; + inherit (lib.attrsets) mapAttrs; inherit (lib.lists) optionals; inherit (lib.types) enum; @@ -22,7 +23,6 @@ in { ''; }; - # TODO: make per-plugin borders configurable plugins = let mkPluginStyleOption = name: { enable = mkEnableOption "borders for the ${name} plugin" // {default = cfg.enable;}; @@ -33,14 +33,15 @@ in { 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"; - }; + 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 + 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"; + }; }; } diff --git a/modules/plugins/ui/borders/default.nix b/modules/plugins/ui/borders/default.nix deleted file mode 100644 index 38b02b8..0000000 --- a/modules/plugins/ui/borders/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - imports = [ - ./borders.nix - ]; -} diff --git a/modules/plugins/ui/default.nix b/modules/plugins/ui/default.nix index 262cdbb..8bb7309 100644 --- a/modules/plugins/ui/default.nix +++ b/modules/plugins/ui/default.nix @@ -1,12 +1,10 @@ { imports = [ - ./noice - ./modes - ./notifications - ./smartcolumn + ./breadcumbs ./colorizer ./illuminate - ./breadcrumbs - ./borders + ./noice + ./notifications + ./smartcolumn ]; }