From a26cdd2d25cc677978f0cada818c4d94b691e0da Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Thu, 9 Jan 2025 08:56:51 +0100 Subject: [PATCH] ui/nvim-ufo: init (#537) * flake: add nvim-ufo * ui/nvim-ufo: init * docs: update relase notes --- docs/release-notes/rl-0.8.md | 2 ++ flake.lock | 34 ++++++++++++++++++++++++ flake.nix | 10 +++++++ modules/plugins/ui/default.nix | 1 + modules/plugins/ui/nvim-ufo/config.nix | 20 ++++++++++++++ modules/plugins/ui/nvim-ufo/default.nix | 6 +++++ modules/plugins/ui/nvim-ufo/nvim-ufo.nix | 9 +++++++ 7 files changed, 82 insertions(+) create mode 100644 modules/plugins/ui/nvim-ufo/config.nix create mode 100644 modules/plugins/ui/nvim-ufo/default.nix create mode 100644 modules/plugins/ui/nvim-ufo/nvim-ufo.nix diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index eb7ca0db..036b673c 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -32,5 +32,7 @@ [horriblename](https://github.com/horriblename): [aerial.nvim](https://github.com/stevearc/aerial.nvim) +[nvim-ufo](https://github.com/kevinhwang91/nvim-ufo) - Add [aerial.nvim] +- Add [nvim-ufo] diff --git a/flake.lock b/flake.lock index 4b56f7fa..d4e745c1 100644 --- a/flake.lock +++ b/flake.lock @@ -1518,6 +1518,22 @@ "type": "github" } }, + "plugin-nvim-ufo": { + "flake": false, + "locked": { + "lastModified": 1735147722, + "narHash": "sha256-etyfm4KpwjYN+kkotOMl0LgbQniILmqMqab4acMtTlw=", + "owner": "kevinhwang91", + "repo": "nvim-ufo", + "rev": "32cb247b893a384f1888b9cd737264159ecf183c", + "type": "github" + }, + "original": { + "owner": "kevinhwang91", + "repo": "nvim-ufo", + "type": "github" + } + }, "plugin-nvim-web-devicons": { "flake": false, "locked": { @@ -1694,6 +1710,22 @@ "type": "github" } }, + "plugin-promise-async": { + "flake": false, + "locked": { + "lastModified": 1722813441, + "narHash": "sha256-9eM66brPjiFlY64vmBetRYrKnpDyN7+/URMm4GsGimA=", + "owner": "kevinhwang91", + "repo": "promise-async", + "rev": "119e8961014c9bfaf1487bf3c2a393d254f337e2", + "type": "github" + }, + "original": { + "owner": "kevinhwang91", + "repo": "promise-async", + "type": "github" + } + }, "plugin-registers": { "flake": false, "locked": { @@ -2191,6 +2223,7 @@ "plugin-nvim-tree-lua": "plugin-nvim-tree-lua", "plugin-nvim-treesitter-context": "plugin-nvim-treesitter-context", "plugin-nvim-ts-autotag": "plugin-nvim-ts-autotag", + "plugin-nvim-ufo": "plugin-nvim-ufo", "plugin-nvim-web-devicons": "plugin-nvim-web-devicons", "plugin-obsidian-nvim": "plugin-obsidian-nvim", "plugin-omnisharp-extended": "plugin-omnisharp-extended", @@ -2202,6 +2235,7 @@ "plugin-plenary-nvim": "plugin-plenary-nvim", "plugin-precognition-nvim": "plugin-precognition-nvim", "plugin-project-nvim": "plugin-project-nvim", + "plugin-promise-async": "plugin-promise-async", "plugin-registers": "plugin-registers", "plugin-render-markdown-nvim": "plugin-render-markdown-nvim", "plugin-rose-pine": "plugin-rose-pine", diff --git a/flake.nix b/flake.nix index f5014afe..c1fe0688 100644 --- a/flake.nix +++ b/flake.nix @@ -720,6 +720,16 @@ flake = false; }; + plugin-promise-async = { + url = "github:kevinhwang91/promise-async"; + flake = false; + }; + + plugin-nvim-ufo = { + url = "github:kevinhwang91/nvim-ufo"; + flake = false; + }; + plugin-new-file-template-nvim = { # (required by new-file-template.nvim) url = "github:otavioschwanck/new-file-template.nvim"; diff --git a/modules/plugins/ui/default.nix b/modules/plugins/ui/default.nix index 34076600..e9489e9b 100644 --- a/modules/plugins/ui/default.nix +++ b/modules/plugins/ui/default.nix @@ -2,6 +2,7 @@ imports = [ ./noice ./modes + ./nvim-ufo ./notifications ./smartcolumn ./colorizer diff --git a/modules/plugins/ui/nvim-ufo/config.nix b/modules/plugins/ui/nvim-ufo/config.nix new file mode 100644 index 00000000..7b40386f --- /dev/null +++ b/modules/plugins/ui/nvim-ufo/config.nix @@ -0,0 +1,20 @@ +{ + lib, + config, + ... +}: let + inherit (lib.modules) mkIf; + + cfg = config.vim.ui.nvim-ufo; +in { + config = mkIf cfg.enable { + vim = { + startPlugins = ["promise-async"]; + lazy.plugins.nvim-ufo = { + package = "nvim-ufo"; + setupModule = "ufo"; + inherit (cfg) setupOpts; + }; + }; + }; +} diff --git a/modules/plugins/ui/nvim-ufo/default.nix b/modules/plugins/ui/nvim-ufo/default.nix new file mode 100644 index 00000000..9f541f97 --- /dev/null +++ b/modules/plugins/ui/nvim-ufo/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./nvim-ufo.nix + ./config.nix + ]; +} diff --git a/modules/plugins/ui/nvim-ufo/nvim-ufo.nix b/modules/plugins/ui/nvim-ufo/nvim-ufo.nix new file mode 100644 index 00000000..d5ad4933 --- /dev/null +++ b/modules/plugins/ui/nvim-ufo/nvim-ufo.nix @@ -0,0 +1,9 @@ +{lib, ...}: let + inherit (lib.options) mkEnableOption; + inherit (lib.nvim.types) mkPluginSetupOption; +in { + options.vim.ui.nvim-ufo = { + enable = mkEnableOption "nvim-ufo"; + setupOpts = mkPluginSetupOption "nvim-ufo" {}; + }; +}