diff --git a/plugins/telescope/default.nix b/plugins/telescope/default.nix index d4609ca6..f5c94c4a 100644 --- a/plugins/telescope/default.nix +++ b/plugins/telescope/default.nix @@ -23,6 +23,22 @@ in { package = helpers.mkPackageOption "telescope.nvim" pkgs.vimPlugins.telescope-nvim; + keymaps = mkOption { + type = types.attrsOf types.str; + description = "Keymaps for telescope."; + default = {}; + example = { + "fg" = "live_grep"; + "" = "git_files"; + }; + }; + + keymapsSilent = mkOption { + type = types.bool; + description = "Whether telescope keymaps should be silent"; + default = false; + }; + highlightTheme = mkOption { type = types.nullOr types.str; description = "The colorscheme to use for syntax highlighting"; @@ -67,6 +83,15 @@ in { let $BAT_THEME = '${cfg.highlightTheme}' ''; + maps.normal = + mapAttrs + (key: action: { + silent = cfg.keymapsSilent; + action = "require('telescope.builtin').${action}"; + lua = true; + }) + cfg.keymaps; + extraConfigLua = let options = {