From 8a148ad71e93c48047a9f9b8cb0b0923f4f6e967 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Tue, 1 Apr 2025 16:41:10 +0300 Subject: [PATCH] ui/colorful-menu-nvim --- docs/release-notes/rl-0.8.md | 8 ++++++-- .../colorful-menu-nvim/colorful-menu-nvim.nix | 9 +++++++++ .../plugins/ui/colorful-menu-nvim/config.nix | 20 +++++++++++++++++++ .../plugins/ui/colorful-menu-nvim/default.nix | 6 ++++++ modules/plugins/ui/default.nix | 17 ++++++++-------- npins/sources.json | 13 ++++++++++++ 6 files changed, 63 insertions(+), 10 deletions(-) create mode 100644 modules/plugins/ui/colorful-menu-nvim/colorful-menu-nvim.nix create mode 100644 modules/plugins/ui/colorful-menu-nvim/config.nix create mode 100644 modules/plugins/ui/colorful-menu-nvim/default.nix diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 1d3e0491..e4f5a5a9 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -26,6 +26,7 @@ [yanky.nvim]: https://github.com/gbprod/yanky.nvim [yazi.nvim]: https://github.com/mikavilpas/yazi.nvim [snacks.nvim]: https://github.com/folke/snacks.nvim +[colorful-menu.nvim]: https://github.com/xzbdmw/colorful-menu.nvim - Add [typst-preview.nvim] under `languages.typst.extensions.typst-preview-nvim`. @@ -83,6 +84,9 @@ - Lazyload Lspsaga and remove default keybindings for it. +- Add [colorful-menu.nvim] to enhance the completion menus, with optional + integration for blink-cmp and nvim-cmp + [amadaluzia](https://github.com/amadaluzia): [haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim @@ -249,8 +253,8 @@ [friendly-snippets](https://github.com/rafamadriz/friendly-snippets) so blink.cmp can source snippets from it. - Fix [blink.cmp] breaking when built-in sources were modified. -- Fix [conform.nvim] not allowing disabling formatting on and after save. - Use `null` value to disable them if conform is enabled. +- Fix [conform.nvim] not allowing disabling formatting on and after save. Use + `null` value to disable them if conform is enabled. [TheColorman](https://github.com/TheColorman): diff --git a/modules/plugins/ui/colorful-menu-nvim/colorful-menu-nvim.nix b/modules/plugins/ui/colorful-menu-nvim/colorful-menu-nvim.nix new file mode 100644 index 00000000..075b3d9a --- /dev/null +++ b/modules/plugins/ui/colorful-menu-nvim/colorful-menu-nvim.nix @@ -0,0 +1,9 @@ +{lib, ...}: let + inherit (lib.options) mkEnableOption; + inherit (lib.nvim.types) mkPluginSetupOption; +in { + options.vim.ui.colorful-menu-nvim = { + enable = mkEnableOption "treesitter highlighted completion menus [colorful-menu.nvim]"; + setupOpts = mkPluginSetupOption "colorful-menu-nvim" {}; + }; +} diff --git a/modules/plugins/ui/colorful-menu-nvim/config.nix b/modules/plugins/ui/colorful-menu-nvim/config.nix new file mode 100644 index 00000000..da300274 --- /dev/null +++ b/modules/plugins/ui/colorful-menu-nvim/config.nix @@ -0,0 +1,20 @@ +{ + config, + lib, + ... +}: let + inherit (lib.modules) mkIf; + inherit (lib.nvim.dag) entryAnywhere; + inherit (lib.nvim.lua) toLuaObject; + + cfg = config.vim.ui.colorful-menu-nvim; +in { + config = mkIf cfg.enable { + vim = { + startPlugins = ["colorful-menu-nvim"]; + pluginRC.colorful-menu-nvim = entryAnywhere '' + require("colorful-menu").setup(${toLuaObject cfg.setupOpts}) + ''; + }; + }; +} diff --git a/modules/plugins/ui/colorful-menu-nvim/default.nix b/modules/plugins/ui/colorful-menu-nvim/default.nix new file mode 100644 index 00000000..198e844e --- /dev/null +++ b/modules/plugins/ui/colorful-menu-nvim/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./config.nix + ./colorful-menu-nvim.nix + ]; +} diff --git a/modules/plugins/ui/default.nix b/modules/plugins/ui/default.nix index e9489e9b..50112650 100644 --- a/modules/plugins/ui/default.nix +++ b/modules/plugins/ui/default.nix @@ -1,14 +1,15 @@ { imports = [ - ./noice - ./modes - ./nvim-ufo - ./notifications - ./smartcolumn - ./colorizer - ./illuminate - ./breadcrumbs ./borders + ./breadcrumbs + ./colorful-menu-nvim + ./colorizer ./fastaction + ./illuminate + ./modes + ./noice + ./notifications + ./nvim-ufo + ./smartcolumn ]; } diff --git a/npins/sources.json b/npins/sources.json index f9091f20..77f5a460 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -289,6 +289,19 @@ "url": "https://github.com/gorbit99/codewindow.nvim/archive/dd7017617962943eb1d152fc58940f11c6775a4a.tar.gz", "hash": "1kxkf50rkqrzqz03jvygbwxb1yfmqh0gskr00vpmyrq51569a2hw" }, + "colorful-menu-nvim": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "xzbdmw", + "repo": "colorful-menu.nvim" + }, + "branch": "master", + "submodules": false, + "revision": "f80feb8a6706f965321aff24d0ed3849f02a7f77", + "url": "https://github.com/xzbdmw/colorful-menu.nvim/archive/f80feb8a6706f965321aff24d0ed3849f02a7f77.tar.gz", + "hash": "1rj6yy7gchdyynhd13l35vhmn8npldmgn4vam9gv244mywpz3flw" + }, "comment-nvim": { "type": "Git", "repository": {