mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-09 16:54:36 +02:00
plugins/telescope: add keymaps and keymapsSilent options (#179)
This commit is contained in:
parent
8f266e86ef
commit
f6c00a8ea5
1 changed files with 25 additions and 0 deletions
|
@ -23,6 +23,22 @@ in {
|
||||||
|
|
||||||
package = helpers.mkPackageOption "telescope.nvim" pkgs.vimPlugins.telescope-nvim;
|
package = helpers.mkPackageOption "telescope.nvim" pkgs.vimPlugins.telescope-nvim;
|
||||||
|
|
||||||
|
keymaps = mkOption {
|
||||||
|
type = types.attrsOf types.str;
|
||||||
|
description = "Keymaps for telescope.";
|
||||||
|
default = {};
|
||||||
|
example = {
|
||||||
|
"<leader>fg" = "live_grep";
|
||||||
|
"<C-p>" = "git_files";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
keymapsSilent = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
description = "Whether telescope keymaps should be silent";
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
|
||||||
highlightTheme = mkOption {
|
highlightTheme = mkOption {
|
||||||
type = types.nullOr types.str;
|
type = types.nullOr types.str;
|
||||||
description = "The colorscheme to use for syntax highlighting";
|
description = "The colorscheme to use for syntax highlighting";
|
||||||
|
@ -67,6 +83,15 @@ in {
|
||||||
let $BAT_THEME = '${cfg.highlightTheme}'
|
let $BAT_THEME = '${cfg.highlightTheme}'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
maps.normal =
|
||||||
|
mapAttrs
|
||||||
|
(key: action: {
|
||||||
|
silent = cfg.keymapsSilent;
|
||||||
|
action = "require('telescope.builtin').${action}";
|
||||||
|
lua = true;
|
||||||
|
})
|
||||||
|
cfg.keymaps;
|
||||||
|
|
||||||
extraConfigLua = let
|
extraConfigLua = let
|
||||||
options =
|
options =
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue