users/foo-dogsquared/programs/nixvim: add fuzzy finding subset

This commit is contained in:
Gabriel Arazas 2024-12-12 10:11:12 +08:00
parent 5af855715e
commit 0557d111ea
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
2 changed files with 43 additions and 0 deletions

View File

@ -17,6 +17,7 @@ in
imports = imports =
[ [
./colorschemes.nix ./colorschemes.nix
./fuzzy-finding.nix
./misc.nix ./misc.nix
./note-taking.nix ./note-taking.nix
] ]

View File

@ -0,0 +1,42 @@
{ config, lib, helpers, hmConfig, ... }:
let
inherit (hmConfig.xdg) userDirs;
telescopeExtensions = config.plugins.telescope.extensions;
in
{
plugins.telescope.extensions.frecency = {
enable = true;
settings = {
show_scores = true;
show_unindexed = true;
workspaces = {
writings = "${userDirs.documents}/Writings";
packages = "${userDirs.extraConfig.XDG_PROJECTS_DIR}/packages";
software = "${userDirs.extraConfig.XDG_PROJECTS_DIR}/software";
};
};
};
plugins.telescope.extensions.live-grep-args = {
enable = true;
};
plugins.telescope.keymaps = lib.mkMerge [
(lib.mkIf telescopeExtensions.frecency.enable {
"<leader>fp" = {
mode = "n";
options.desc = "List projects";
action = helpers.mkRaw "require('telescope').extensions.project.project{}";
};
})
(lib.mkIf telescopeExtensions.live-grep-args.enable {
"<leader>fG" = {
mode = "n";
options.desc = "Live grep (with args) for the whole project";
action = helpers.mkRaw "require('telescope').extensions.live_grep_args.live_grep_args";
};
})
];
}