plugins/grug-far: init

This commit is contained in:
Austin Horstman 2024-12-11 16:05:41 -06:00
parent 54b1d91299
commit 2844c31655
No known key found for this signature in database
2 changed files with 80 additions and 0 deletions

View file

@ -0,0 +1,23 @@
{ lib, ... }:
lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "grug-far";
originalName = "grug-far.nvim";
package = "grug-far-nvim";
maintainers = [ lib.maintainers.khaneliman ];
settingsExample = {
debounceMs = 1000;
minSearchChars = 1;
maxSearchMatches = 2000;
normalModeSearch = false;
maxWorkers = 8;
engine = "ripgrep";
engines = {
ripgrep = {
path = "rg";
showReplaceDiff = true;
};
};
};
}

View file

@ -0,0 +1,57 @@
{
empty = {
plugins.grug-far.enable = true;
};
# Just a small subset of the settings
defaults = {
plugins.grug-far = {
enable = true;
settings = {
debounceMs = 500;
minSearchChars = 2;
maxSearchMatches = 2000;
normalModeSearch = false;
maxWorkers = 4;
engine = "ripgrep";
engines = {
ripgrep = {
path = "rg";
extraArgs = "";
showReplaceDiff = true;
placeholders = {
enabled = true;
search = "ex: foo foo([a-z0-9]*) fun\\(";
replacement = ''ex: bar $${1}_foo $$MY_ENV_VAR'';
replacement_lua = ''ex: if vim.startsWith(match; "use") \\n then return "employ" .. match \\n else return match end'';
filesFilter = ''ex: *.lua *.{css;js} **/docs/*.md (specify one per line)'';
flags = "ex: --help --ignore-case (-i) --replace= (empty replace) --multiline (-U)";
paths = "ex: /foo/bar ../ ./hello\\ world/ ./src/foo.lua ~/.config";
};
};
};
};
};
};
example = {
plugins.grug-far = {
enable = true;
settings = {
debounceMs = 1000;
minSearchChars = 1;
maxSearchMatches = 2000;
normalModeSearch = false;
maxWorkers = 8;
engine = "ripgrep";
engines = {
ripgrep = {
path = "rg";
showReplaceDiff = true;
};
};
};
};
};
}