mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
modules/dependencies: add ripgrep
This commit is contained in:
parent
238ffa110a
commit
d6cdbf36b2
7 changed files with 54 additions and 59 deletions
|
@ -27,6 +27,7 @@ let
|
||||||
default = "nodejs";
|
default = "nodejs";
|
||||||
example = "pkgs.nodejs_22";
|
example = "pkgs.nodejs_22";
|
||||||
};
|
};
|
||||||
|
ripgrep.default = "ripgrep";
|
||||||
texpresso.default = "texpresso";
|
texpresso.default = "texpresso";
|
||||||
tinymist.default = "tinymist";
|
tinymist.default = "tinymist";
|
||||||
tree-sitter.default = "tree-sitter";
|
tree-sitter.default = "tree-sitter";
|
||||||
|
|
|
@ -17,11 +17,19 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
You may want to set the package for your find/replace tool(s) like shown below:
|
You may want to set the package for your find/replace tool(s) like shown below:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
plugins.spectre.findPackage = pkgs.rg;
|
|
||||||
plugins.spectre.replacePackage = pkgs.gnused;
|
plugins.spectre.replacePackage = pkgs.gnused;
|
||||||
```
|
```
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
# TODO: added 2025-04-07, remove after 25.05
|
||||||
|
(lib.nixvim.mkRemovedPackageOptionModule {
|
||||||
|
plugin = "spectre";
|
||||||
|
packageName = "ripgrep";
|
||||||
|
oldPackageName = "find";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
settingsOptions =
|
settingsOptions =
|
||||||
let
|
let
|
||||||
mkEngineOption =
|
mkEngineOption =
|
||||||
|
@ -231,11 +239,6 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
let
|
let
|
||||||
defaults = config.plugins.spectre.settings.default;
|
defaults = config.plugins.spectre.settings.default;
|
||||||
|
|
||||||
# NOTE: changes here should also be reflected in the `defaultText` below
|
|
||||||
findPackages = {
|
|
||||||
rg = pkgs.ripgrep;
|
|
||||||
};
|
|
||||||
|
|
||||||
# NOTE: changes here should also be reflected in the `defaultText` below
|
# NOTE: changes here should also be reflected in the `defaultText` below
|
||||||
replacePackages = {
|
replacePackages = {
|
||||||
sed = pkgs.gnused;
|
sed = pkgs.gnused;
|
||||||
|
@ -243,24 +246,6 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
findPackage = lib.mkOption {
|
|
||||||
type = with lib.types; nullOr package;
|
|
||||||
default = findPackages.${toString defaults.find.cmd} or null;
|
|
||||||
defaultText = literalMD ''
|
|
||||||
Based on the value defined in `config.plugins.spectre.settings.default.find.cmd`,
|
|
||||||
if the value defined there is a key in the attrset below, then the corresponding value is used. Otherwise the default will be `null`.
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{
|
|
||||||
rg = pkgs.ripgrep;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
'';
|
|
||||||
description = ''
|
|
||||||
The package to use for the find command.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
replacePackage = lib.mkOption {
|
replacePackage = lib.mkOption {
|
||||||
type = with lib.types; nullOr package;
|
type = with lib.types; nullOr package;
|
||||||
default = replacePackages.${toString defaults.replace.cmd} or null;
|
default = replacePackages.${toString defaults.replace.cmd} or null;
|
||||||
|
@ -282,8 +267,14 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
};
|
};
|
||||||
|
|
||||||
extraConfig = cfg: {
|
extraConfig = cfg: {
|
||||||
|
dependencies =
|
||||||
|
let
|
||||||
|
defaults = cfg.settings.default;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
ripgrep.enable = lib.mkIf (defaults.find.cmd == "rg") (lib.mkDefault true);
|
||||||
|
};
|
||||||
extraPackages = [
|
extraPackages = [
|
||||||
cfg.findPackage
|
|
||||||
cfg.replacePackage
|
cfg.replacePackage
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
@ -13,6 +12,19 @@ mkExtension {
|
||||||
extensionName = "live_grep_args";
|
extensionName = "live_grep_args";
|
||||||
package = "telescope-live-grep-args-nvim";
|
package = "telescope-live-grep-args-nvim";
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
# TODO: added 2025-04-07, remove after 25.05
|
||||||
|
(lib.nixvim.mkRemovedPackageOptionModule {
|
||||||
|
plugin = [
|
||||||
|
"telescope"
|
||||||
|
"extensions"
|
||||||
|
"live-grep-args"
|
||||||
|
];
|
||||||
|
packageName = "ripgrep";
|
||||||
|
oldPackageName = "grep";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
settingsOptions = {
|
settingsOptions = {
|
||||||
auto_quoting = defaultNullOpts.mkBool true ''
|
auto_quoting = defaultNullOpts.mkBool true ''
|
||||||
Enable or disable auto quoting of searches.
|
Enable or disable auto quoting of searches.
|
||||||
|
@ -56,14 +68,7 @@ mkExtension {
|
||||||
theme = "dropdown";
|
theme = "dropdown";
|
||||||
};
|
};
|
||||||
|
|
||||||
extraOptions = {
|
extraConfig = {
|
||||||
grepPackage = lib.mkPackageOption pkgs "ripgrep" {
|
dependencies.ripgrep.enable = lib.mkDefault true;
|
||||||
nullable = true;
|
|
||||||
example = "pkgs.gnugrep";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
extraConfig = cfg: {
|
|
||||||
extraPackages = [ cfg.grepPackage ];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
pkgs,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
|
@ -22,13 +21,19 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
|
|
||||||
maintainers = [ lib.maintainers.khaneliman ];
|
maintainers = [ lib.maintainers.khaneliman ];
|
||||||
|
|
||||||
# TODO: Added 2023-11-06, remove after 24.11
|
|
||||||
imports = [
|
imports = [
|
||||||
|
# TODO: Added 2023-11-06, remove after 24.11
|
||||||
(mkRemovedOptionModule [
|
(mkRemovedOptionModule [
|
||||||
"plugins"
|
"plugins"
|
||||||
"todo-comments"
|
"todo-comments"
|
||||||
"keymapsSilent"
|
"keymapsSilent"
|
||||||
] "Use `plugins.todo-comments.keymaps.<COMMAND>.options.silent`.")
|
] "Use `plugins.todo-comments.keymaps.<COMMAND>.options.silent`.")
|
||||||
|
|
||||||
|
# TODO: added 2025-04-07, remove after 25.05
|
||||||
|
(lib.nixvim.mkRemovedPackageOptionModule {
|
||||||
|
plugin = "todo-comments";
|
||||||
|
packageName = "ripgrep";
|
||||||
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
# TODO: Added 2024-08-16, remove after 24.11
|
# TODO: Added 2024-08-16, remove after 24.11
|
||||||
|
@ -407,10 +412,6 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
todoTrouble = "TodoTrouble";
|
todoTrouble = "TodoTrouble";
|
||||||
todoTelescope = "TodoTelescope";
|
todoTelescope = "TodoTelescope";
|
||||||
};
|
};
|
||||||
|
|
||||||
ripgrepPackage = lib.mkPackageOption pkgs "ripgrep" {
|
|
||||||
nullable = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extraConfig = cfg: {
|
extraConfig = cfg: {
|
||||||
|
@ -431,7 +432,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
extraPackages = [ cfg.ripgrepPackage ];
|
dependencies.ripgrep.enable = lib.mkDefault true;
|
||||||
|
|
||||||
keymaps = lib.pipe cfg.keymaps [
|
keymaps = lib.pipe cfg.keymaps [
|
||||||
(filterAttrs (n: keymap: keymap != null && keymap.key != null))
|
(filterAttrs (n: keymap: keymap != null && keymap.key != null))
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
plugins.spectre = {
|
plugins.spectre = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
findPackage = pkgs.ripgrep;
|
|
||||||
replacePackage = pkgs.gnused;
|
replacePackage = pkgs.gnused;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -49,26 +49,26 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
custom-packages = {
|
custom-packages = {
|
||||||
plugins.telescope = {
|
plugins = {
|
||||||
|
telescope = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
extensions.live-grep-args = {
|
extensions.live-grep-args.enable = true;
|
||||||
enable = true;
|
|
||||||
grepPackage = pkgs.gnugrep;
|
|
||||||
};
|
};
|
||||||
|
web-devicons.enable = true;
|
||||||
};
|
};
|
||||||
plugins.web-devicons.enable = true;
|
dependencies.ripgrep.package = pkgs.gnugrep;
|
||||||
};
|
};
|
||||||
|
|
||||||
no-packages = {
|
no-packages = {
|
||||||
plugins.telescope = {
|
plugins = {
|
||||||
|
telescope = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
extensions.live-grep-args = {
|
extensions.live-grep-args.enable = true;
|
||||||
enable = true;
|
|
||||||
grepPackage = null;
|
|
||||||
};
|
};
|
||||||
|
web-devicons.enable = false;
|
||||||
};
|
};
|
||||||
plugins.web-devicons.enable = false;
|
dependencies.ripgrep.enable = false;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -191,11 +191,9 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
without-ripgrep = {
|
without-ripgrep = {
|
||||||
plugins.todo-comments = {
|
plugins.todo-comments.enable = true;
|
||||||
enable = true;
|
|
||||||
|
|
||||||
ripgrepPackage = null;
|
dependencies.ripgrep.enable = false;
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
highlight-pattern-list = {
|
highlight-pattern-list = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue