mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-07 14:55:59 +01:00
utility/telescope: provide configurable vimgrep options
This commit is contained in:
parent
a519c6364c
commit
4e8ec4cd5b
2 changed files with 25 additions and 14 deletions
|
@ -5,9 +5,10 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetBinding nvim;
|
inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetBinding nvim;
|
||||||
|
inherit (nvim.lua) listToLuaTable;
|
||||||
|
|
||||||
cfg = config.vim.telescope;
|
cfg = config.vim.telescope;
|
||||||
self = import ./telescope.nix {inherit lib;};
|
self = import ./telescope.nix {inherit pkgs lib;};
|
||||||
mappingDefinitions = self.options.vim.telescope.mappings;
|
mappingDefinitions = self.options.vim.telescope.mappings;
|
||||||
|
|
||||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||||
|
@ -56,17 +57,7 @@ in {
|
||||||
local telescope = require('telescope')
|
local telescope = require('telescope')
|
||||||
telescope.setup {
|
telescope.setup {
|
||||||
defaults = {
|
defaults = {
|
||||||
vimgrep_arguments = {
|
vimgrep_arguments = ${listToLuaTable cfg.vimgrep_arguments},
|
||||||
"${pkgs.ripgrep}/bin/rg",
|
|
||||||
"--color=never",
|
|
||||||
"--no-heading",
|
|
||||||
"--with-filename",
|
|
||||||
"--line-number",
|
|
||||||
"--column",
|
|
||||||
"--smart-case",
|
|
||||||
"--hidden",
|
|
||||||
"--no-ignore",
|
|
||||||
},
|
|
||||||
pickers = {
|
pickers = {
|
||||||
find_command = {
|
find_command = {
|
||||||
"${pkgs.fd}/bin/fd",
|
"${pkgs.fd}/bin/fd",
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
{lib, ...}: let
|
{
|
||||||
inherit (lib) mkMappingOption mkEnableOption;
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib) mkMappingOption mkEnableOption mkOption types;
|
||||||
in {
|
in {
|
||||||
options.vim.telescope = {
|
options.vim.telescope = {
|
||||||
mappings = {
|
mappings = {
|
||||||
|
@ -29,5 +33,21 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
enable = mkEnableOption "telescope.nvim: multi-purpose search and picker utility";
|
enable = mkEnableOption "telescope.nvim: multi-purpose search and picker utility";
|
||||||
|
|
||||||
|
vimgrep_arguments = mkOption {
|
||||||
|
description = "Arguments to use for the grep command";
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [
|
||||||
|
"${pkgs.ripgrep}/bin/rg"
|
||||||
|
"--color=never"
|
||||||
|
"--no-heading"
|
||||||
|
"--with-filename"
|
||||||
|
"--line-number"
|
||||||
|
"--column"
|
||||||
|
"--smart-case"
|
||||||
|
"--hidden"
|
||||||
|
"--no-ignore"
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue