mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-25 18:19:00 +00:00
nixvimConfigs/fiesta/setups/fuzzy-finder: init
This commit is contained in:
parent
3bdaa63231
commit
fc7eb5f7de
@ -9,6 +9,7 @@
|
|||||||
ui.enable = true;
|
ui.enable = true;
|
||||||
completion.enable = true;
|
completion.enable = true;
|
||||||
treesitter.enable = true;
|
treesitter.enable = true;
|
||||||
|
fuzzy-finder.enable = true;
|
||||||
debugging.enable = true;
|
debugging.enable = true;
|
||||||
desktop-utils.enable = true;
|
desktop-utils.enable = true;
|
||||||
note-taking.enable = true;
|
note-taking.enable = true;
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
./setups/completion.nix
|
./setups/completion.nix
|
||||||
./setups/debugging.nix
|
./setups/debugging.nix
|
||||||
./setups/desktop-utils.nix
|
./setups/desktop-utils.nix
|
||||||
|
./setups/fuzzy-finder.nix
|
||||||
./setups/snippets
|
./setups/snippets
|
||||||
./setups/treesitter.nix
|
./setups/treesitter.nix
|
||||||
./setups/ui.nix
|
./setups/ui.nix
|
||||||
|
88
configs/nixvim/fiesta/modules/setups/fuzzy-finder.nix
Normal file
88
configs/nixvim/fiesta/modules/setups/fuzzy-finder.nix
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
nixvimCfg = config.nixvimConfigs.fiesta;
|
||||||
|
cfg = nixvimCfg.setups.fuzzy-finder;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.nixvimConfigs.fiesta.setups.fuzzy-finder.enable =
|
||||||
|
lib.mkEnableOption "fuzzy finder setup";
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
plugins.telescope.enable = true;
|
||||||
|
|
||||||
|
# Configure all of the keymaps.
|
||||||
|
keymaps =
|
||||||
|
let
|
||||||
|
bindingPrefix = "<leader>f";
|
||||||
|
mkTelescopeKeymap = acc: binding: settings:
|
||||||
|
acc ++ [
|
||||||
|
(lib.mergeAttrs {
|
||||||
|
mode = "n";
|
||||||
|
key = "${bindingPrefix}${binding}";
|
||||||
|
} settings)
|
||||||
|
];
|
||||||
|
in
|
||||||
|
lib.foldlAttrs mkTelescopeKeymap [ ] ({
|
||||||
|
"A" = {
|
||||||
|
options.desc = "Resume from last use";
|
||||||
|
action = "require('telescope.builtin').resume";
|
||||||
|
lua = true;
|
||||||
|
};
|
||||||
|
"b" = {
|
||||||
|
options.desc = "List buffers";
|
||||||
|
action = "require('telescope.builtin').buffers";
|
||||||
|
lua = true;
|
||||||
|
};
|
||||||
|
"f" = {
|
||||||
|
options.desc = "Find files";
|
||||||
|
action = ''
|
||||||
|
function()
|
||||||
|
require('telescope.builtin').find_files { hidden = true }
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
lua = true;
|
||||||
|
};
|
||||||
|
"F" = {
|
||||||
|
options.desc = "Find files in current directory";
|
||||||
|
action = ''
|
||||||
|
function()
|
||||||
|
require('telescope.builtin').find_files {
|
||||||
|
cwd = require('telescope.utils').buffer_dir(),
|
||||||
|
hidden = true,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
lua = true;
|
||||||
|
};
|
||||||
|
"g" = {
|
||||||
|
options.desc = "Find files tracked by Git";
|
||||||
|
action = "require('telescope.builtin').git_files";
|
||||||
|
lua = true;
|
||||||
|
};
|
||||||
|
"G" = {
|
||||||
|
options.desc = "Live grep for the whole project";
|
||||||
|
action = "require('telescope.builtin').live_grep";
|
||||||
|
lua = true;
|
||||||
|
};
|
||||||
|
"h" = {
|
||||||
|
options.desc = "Find section from help tags";
|
||||||
|
action = "require('telescope.builtin').help_tags";
|
||||||
|
lua = true;
|
||||||
|
};
|
||||||
|
"m" = {
|
||||||
|
options.desc = "Find manpage entries";
|
||||||
|
action = "require('telescope.builtin').man_pages";
|
||||||
|
lua = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
// lib.optionalAttrs nixvimCfg.setups.treesitter.enable {
|
||||||
|
"t" = {
|
||||||
|
options.desc = "List symbols from treesitter queries";
|
||||||
|
action = "require('telescope.builtin').treesitter";
|
||||||
|
lua = true;
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user