mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-06-13 08:15:10 +00:00
plugins/utility/fff-nvim: add fff.nvim module
Adds fff.nvim, a high-performance Rust-backed file picker for Neovim with fuzzy search and frecency scoring. The Rust shared library is built from source via rustPlatform.buildRustPackage and symlinked into target/release/ where the plugin's lua loader expects it. Toggle with vim.utility.fff-nvim.enable; pass arbitrary fff.setup() options through vim.utility.fff-nvim.setupOpts.
This commit is contained in:
parent
a6f49d9a4e
commit
10aa76214c
7 changed files with 184 additions and 1 deletions
58
flake/pkgs/by-name/fff-nvim/package.nix
Normal file
58
flake/pkgs/by-name/fff-nvim/package.nix
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
lib,
|
||||
pins,
|
||||
rustPlatform,
|
||||
stdenv,
|
||||
vimUtils,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
pin = pins.fff-nvim;
|
||||
|
||||
pname = "fff-nvim-lib";
|
||||
version = pin.revision;
|
||||
src = pkgs.fetchFromGitHub {
|
||||
inherit (pin.repository) owner repo;
|
||||
rev = pin.revision;
|
||||
sha256 = pin.hash;
|
||||
};
|
||||
|
||||
fff-nvim-lib = rustPlatform.buildRustPackage {
|
||||
inherit pname version src;
|
||||
|
||||
cargoLock = {
|
||||
lockFile = "${src}/Cargo.lock";
|
||||
};
|
||||
|
||||
cargoBuildFlags = ["-p" "fff-nvim"];
|
||||
cargoTestFlags = ["-p" "fff-nvim"];
|
||||
|
||||
doCheck = false;
|
||||
|
||||
env.RUSTFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-C link-arg=-undefined -C link-arg=dynamic_lookup";
|
||||
};
|
||||
in
|
||||
vimUtils.buildVimPlugin {
|
||||
pname = "fff-nvim";
|
||||
inherit version src;
|
||||
|
||||
doCheck = false;
|
||||
|
||||
postInstall = let
|
||||
ext = stdenv.hostPlatform.extensions.sharedLibrary;
|
||||
in ''
|
||||
mkdir -p $out/target/release
|
||||
ln -s ${fff-nvim-lib}/lib/libfff_nvim${ext} $out/target/release/libfff_nvim${ext}
|
||||
'';
|
||||
|
||||
nvimSkipModules = [
|
||||
"fff.download"
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "A high-performance Neovim file picker with fuzzy search and frecency scoring";
|
||||
homepage = "https://github.com/dmtrKovalenko/fff";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = [];
|
||||
};
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@
|
|||
./ccc
|
||||
./diffview
|
||||
./direnv
|
||||
./fff-nvim
|
||||
./fzf-lua
|
||||
./gestures
|
||||
./harpoon
|
||||
|
|
|
|||
25
modules/plugins/utility/fff-nvim/config.nix
Normal file
25
modules/plugins/utility/fff-nvim/config.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
|
||||
cfg = config.vim.utility.fff-nvim;
|
||||
in {
|
||||
vim.lazy.plugins."fff-nvim" = mkIf cfg.enable {
|
||||
package = "fff-nvim";
|
||||
setupModule = "fff";
|
||||
inherit (cfg) setupOpts;
|
||||
|
||||
cmd = [
|
||||
"FFFFind"
|
||||
"FFFScan"
|
||||
"FFFRefreshGit"
|
||||
"FFFClearCache"
|
||||
"FFFHealth"
|
||||
"FFFDebug"
|
||||
"FFFOpenLog"
|
||||
];
|
||||
};
|
||||
}
|
||||
6
modules/plugins/utility/fff-nvim/default.nix
Normal file
6
modules/plugins/utility/fff-nvim/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./fff-nvim.nix
|
||||
./config.nix
|
||||
];
|
||||
}
|
||||
80
modules/plugins/utility/fff-nvim/fff-nvim.nix
Normal file
80
modules/plugins/utility/fff-nvim/fff-nvim.nix
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
{
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) attrs;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
in {
|
||||
options.vim.utility.fff-nvim = {
|
||||
enable = mkEnableOption "fff.nvim, a fast file picker for Neovim";
|
||||
|
||||
setupOpts = mkPluginSetupOption "fff.nvim" {
|
||||
base_path = mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
description = "Base directory for searching files. Defaults to the current working directory.";
|
||||
};
|
||||
|
||||
prompt = mkOption {
|
||||
type = lib.types.str;
|
||||
default = " ";
|
||||
description = "Prompt symbol used by the picker.";
|
||||
};
|
||||
|
||||
title = mkOption {
|
||||
type = lib.types.str;
|
||||
default = "FFF Files";
|
||||
description = "Title of the picker window.";
|
||||
};
|
||||
|
||||
max_results = mkOption {
|
||||
type = lib.types.int;
|
||||
default = 100;
|
||||
description = "Maximum number of results to display.";
|
||||
};
|
||||
|
||||
max_threads = mkOption {
|
||||
type = lib.types.int;
|
||||
default = 4;
|
||||
description = "Maximum number of background threads used for search.";
|
||||
};
|
||||
|
||||
layout = mkOption {
|
||||
type = attrs;
|
||||
default = {};
|
||||
description = "Layout settings (height, width, prompt_position, preview_position, ...).";
|
||||
};
|
||||
|
||||
preview = mkOption {
|
||||
type = attrs;
|
||||
default = {};
|
||||
description = "Preview settings (enabled, max_size, line_numbers, ...).";
|
||||
};
|
||||
|
||||
keymaps = mkOption {
|
||||
type = attrs;
|
||||
default = {};
|
||||
description = "Keymap overrides for the picker.";
|
||||
};
|
||||
|
||||
icons = mkOption {
|
||||
type = attrs;
|
||||
default = {};
|
||||
description = "Icon settings (requires a Nerd Font / icon provider).";
|
||||
};
|
||||
|
||||
frecency = mkOption {
|
||||
type = attrs;
|
||||
default = {};
|
||||
description = "Frecency database settings.";
|
||||
};
|
||||
|
||||
debug = mkOption {
|
||||
type = attrs;
|
||||
default = {};
|
||||
description = "Debug-related settings.";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
# Get plugins built from source from self.packages
|
||||
# If adding a new plugin to be built from source, it must also be inherited
|
||||
# here.
|
||||
inherit (inputs.self.packages.${pkgs.stdenv.system}) blink-cmp avante-nvim;
|
||||
inherit (inputs.self.packages.${pkgs.stdenv.system}) blink-cmp avante-nvim fff-nvim;
|
||||
};
|
||||
|
||||
buildConfigPlugins = plugins:
|
||||
|
|
|
|||
|
|
@ -530,6 +530,19 @@
|
|||
"url": "https://github.com/Chaitanyabsprip/fastaction.nvim/archive/b147d91727cb35be4f722f17e7d4ed5b4a5801d8.tar.gz",
|
||||
"hash": "sha256-va00sqM2Ap9faUXww5CpWJQyCixN9fIwh8p8oSLQMy8="
|
||||
},
|
||||
"fff-nvim": {
|
||||
"type": "Git",
|
||||
"repository": {
|
||||
"type": "GitHub",
|
||||
"owner": "dmtrKovalenko",
|
||||
"repo": "fff"
|
||||
},
|
||||
"branch": "main",
|
||||
"submodules": false,
|
||||
"revision": "7d7910b6ba78ea8406671eaac8cdb5eb9850d9d1",
|
||||
"url": "https://github.com/dmtrKovalenko/fff/archive/7d7910b6ba78ea8406671eaac8cdb5eb9850d9d1.tar.gz",
|
||||
"hash": "sha256-q/RfjfVZMM8RyfOP1o2NjUP6NrOh7D2ribgq5Dvwxkc="
|
||||
},
|
||||
"fidget-nvim": {
|
||||
"type": "Git",
|
||||
"repository": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue