From f279e3a5856fb090b28f5ff69b8ce09e51349b67 Mon Sep 17 00:00:00 2001 From: LilleAila Date: Fri, 17 Jan 2025 21:53:44 +0100 Subject: [PATCH 1/5] utility/fzf-lua: init --- flake.lock | 17 +++++++++++++++++ flake.nix | 7 ++++++- modules/plugins/utility/default.nix | 1 + modules/plugins/utility/fzf-lua/config.nix | 16 ++++++++++++++++ modules/plugins/utility/fzf-lua/default.nix | 6 ++++++ modules/plugins/utility/fzf-lua/fzf-lua.nix | 18 ++++++++++++++++++ 6 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 modules/plugins/utility/fzf-lua/config.nix create mode 100644 modules/plugins/utility/fzf-lua/default.nix create mode 100644 modules/plugins/utility/fzf-lua/fzf-lua.nix diff --git a/flake.lock b/flake.lock index 918b0ce10..e28d03b5d 100644 --- a/flake.lock +++ b/flake.lock @@ -599,6 +599,22 @@ "type": "github" } }, + "plugin-fzf-lua": { + "flake": false, + "locked": { + "lastModified": 1737131132, + "narHash": "sha256-0IdADUsIr+SZ0ort92jPPfGIH1EdcwELYz+TCmDCPPI=", + "owner": "ibhagwan", + "repo": "fzf-lua", + "rev": "fbe21aeb147b3dc8b188b5753a8e288ecedcee5e", + "type": "github" + }, + "original": { + "owner": "ibhagwan", + "repo": "fzf-lua", + "type": "github" + } + }, "plugin-gesture-nvim": { "flake": false, "locked": { @@ -2127,6 +2143,7 @@ "plugin-fidget-nvim": "plugin-fidget-nvim", "plugin-flutter-tools": "plugin-flutter-tools", "plugin-friendly-snippets": "plugin-friendly-snippets", + "plugin-fzf-lua": "plugin-fzf-lua", "plugin-gesture-nvim": "plugin-gesture-nvim", "plugin-gitsigns-nvim": "plugin-gitsigns-nvim", "plugin-glow-nvim": "plugin-glow-nvim", diff --git a/flake.nix b/flake.nix index 02ceb667b..194438137 100644 --- a/flake.nix +++ b/flake.nix @@ -236,12 +236,17 @@ flake = false; }; - # Telescope + # Pickers plugin-telescope = { url = "github:nvim-telescope/telescope.nvim"; flake = false; }; + plugin-fzf-lua = { + url = "github:ibhagwan/fzf-lua"; + flake = false; + }; + # Runners plugin-run-nvim = { url = "github:diniamo/run.nvim"; diff --git a/modules/plugins/utility/default.nix b/modules/plugins/utility/default.nix index 686295e27..8b25ea8f4 100644 --- a/modules/plugins/utility/default.nix +++ b/modules/plugins/utility/default.nix @@ -14,5 +14,6 @@ ./wakatime ./surround ./preview + ./fzf-lua ]; } diff --git a/modules/plugins/utility/fzf-lua/config.nix b/modules/plugins/utility/fzf-lua/config.nix new file mode 100644 index 000000000..558f3cd18 --- /dev/null +++ b/modules/plugins/utility/fzf-lua/config.nix @@ -0,0 +1,16 @@ +{ + config, + lib, + ... +}: let + inherit (lib.modules) mkIf; + + cfg = config.vim.fzf-lua; +in { + vim.lazy.plugins."fzf-lua" = mkIf cfg.enable { + package = "fzf-lua"; + cmd = ["FzfLua"]; + setupModule = "fzf-lua"; + inherit (cfg) setupOpts; + }; +} diff --git a/modules/plugins/utility/fzf-lua/default.nix b/modules/plugins/utility/fzf-lua/default.nix new file mode 100644 index 000000000..e5147e44c --- /dev/null +++ b/modules/plugins/utility/fzf-lua/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./fzf-lua.nix + ./config.nix + ]; +} diff --git a/modules/plugins/utility/fzf-lua/fzf-lua.nix b/modules/plugins/utility/fzf-lua/fzf-lua.nix new file mode 100644 index 000000000..099911bee --- /dev/null +++ b/modules/plugins/utility/fzf-lua/fzf-lua.nix @@ -0,0 +1,18 @@ +{ + config, + lib, + ... +}: let + inherit (lib.options) mkEnableOption mkOption; + inherit (lib.nvim.types) mkPluginSetupOption borderType; +in { + options.vim.fzf-lua = { + enable = mkEnableOption "fzf-lua"; + setupOpts = mkPluginSetupOption "mini.ai" { + winopts.border = mkOption { + type = borderType; + default = config.vim.ui.borders.globalStyle; + }; + }; + }; +} From ce7017cf5ba6ea53359d002c8433e18b1a6dd83b Mon Sep 17 00:00:00 2001 From: LilleAila Date: Fri, 17 Jan 2025 21:55:06 +0100 Subject: [PATCH 2/5] utility/fzf-lua: add changelog --- docs/release-notes/rl-0.8.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index e854eebc6..9271e7962 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -59,6 +59,7 @@ - Add `vim.snippets.luasnip.setupOpts`, which was previously missing. - Add `"prettierd"` as a formatter option in `vim.languages.markdown.format.type`. +- Add [fzf-lua](https://github.com/ibhagwan/fzf-lua) in `vim.fzf-lua` [kaktu5](https://github.com/kaktu5): From 775963dd9dcd3b82746a558b12dad445288ecc9e Mon Sep 17 00:00:00 2001 From: LilleAila Date: Fri, 17 Jan 2025 22:02:25 +0100 Subject: [PATCH 3/5] utility/fzf-lua: add border option description --- modules/plugins/utility/fzf-lua/fzf-lua.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/plugins/utility/fzf-lua/fzf-lua.nix b/modules/plugins/utility/fzf-lua/fzf-lua.nix index 099911bee..3b45ab022 100644 --- a/modules/plugins/utility/fzf-lua/fzf-lua.nix +++ b/modules/plugins/utility/fzf-lua/fzf-lua.nix @@ -12,6 +12,7 @@ in { winopts.border = mkOption { type = borderType; default = config.vim.ui.borders.globalStyle; + description = "Border type for the fzf-lua picker window"; }; }; }; From ba55a1b54a5b5c4d0cc0d035132a9bc9c0733db6 Mon Sep 17 00:00:00 2001 From: LilleAila Date: Sat, 18 Jan 2025 10:10:59 +0100 Subject: [PATCH 4/5] utility/fzf-lua: add profile option, fix name --- modules/plugins/utility/fzf-lua/config.nix | 2 +- modules/plugins/utility/fzf-lua/fzf-lua.nix | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/modules/plugins/utility/fzf-lua/config.nix b/modules/plugins/utility/fzf-lua/config.nix index 558f3cd18..85425fc7e 100644 --- a/modules/plugins/utility/fzf-lua/config.nix +++ b/modules/plugins/utility/fzf-lua/config.nix @@ -11,6 +11,6 @@ in { package = "fzf-lua"; cmd = ["FzfLua"]; setupModule = "fzf-lua"; - inherit (cfg) setupOpts; + setupOpts = cfg.setupOpts // {"@1" = cfg.profile;}; }; } diff --git a/modules/plugins/utility/fzf-lua/fzf-lua.nix b/modules/plugins/utility/fzf-lua/fzf-lua.nix index 3b45ab022..5657f6664 100644 --- a/modules/plugins/utility/fzf-lua/fzf-lua.nix +++ b/modules/plugins/utility/fzf-lua/fzf-lua.nix @@ -3,17 +3,35 @@ lib, ... }: let + inherit (lib.types) nullOr enum; inherit (lib.options) mkEnableOption mkOption; inherit (lib.nvim.types) mkPluginSetupOption borderType; in { options.vim.fzf-lua = { enable = mkEnableOption "fzf-lua"; - setupOpts = mkPluginSetupOption "mini.ai" { + setupOpts = mkPluginSetupOption "fzf-lua" { winopts.border = mkOption { type = borderType; default = config.vim.ui.borders.globalStyle; description = "Border type for the fzf-lua picker window"; }; }; + profile = mkOption { + type = enum [ + "default" + "default-title" + "fzf-native" + "fzf-tmux" + "fzf-vim" + "max-perf" + "telescope" + "skim" + "borderless" + "borderless-full" + "border-fused" + ]; + default = "default"; + description = "The configuration profile ot use"; + }; }; } From f338fd3411589b16340b7560eb7476f1438fa536 Mon Sep 17 00:00:00 2001 From: LilleAila Date: Sat, 18 Jan 2025 10:12:33 +0100 Subject: [PATCH 5/5] utility/fzf-lua: fix typo in profile description --- modules/plugins/utility/fzf-lua/fzf-lua.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/plugins/utility/fzf-lua/fzf-lua.nix b/modules/plugins/utility/fzf-lua/fzf-lua.nix index 5657f6664..c700add7b 100644 --- a/modules/plugins/utility/fzf-lua/fzf-lua.nix +++ b/modules/plugins/utility/fzf-lua/fzf-lua.nix @@ -31,7 +31,7 @@ in { "border-fused" ]; default = "default"; - description = "The configuration profile ot use"; + description = "The configuration profile to use"; }; }; }