switch from telescope-repo to telescope-project

This commit is contained in:
cswimr 2025-02-05 10:34:45 -06:00
parent 2b0bdc994a
commit eae5d72091
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087
2 changed files with 30 additions and 20 deletions

View file

@ -31,7 +31,7 @@
key = "f";
}
{
action = "Telescope repo list";
action = "Telescope project display_type=full hide_workspace=true";
desc = " Projects";
group = "DiagnosticHint";
key = "p";

View file

@ -19,14 +19,28 @@
settings = {
hijack_netrw = false;
grouped = true;
hidden = true;
};
};
project = {
enable = true;
settings = {
base_dirs = [
{
path = "~/Projects";
max_depth = 3;
}
{
path = "/etc/nixos";
max_depth = 1;
}
];
};
};
};
enabledExtensions = [
"repo"
];
settings = {
defaults = {
prompt_prefix = "🔍";
layout_config = {
prompt_position = "bottom";
};
@ -34,18 +48,6 @@
};
};
};
extraPlugins = [
(pkgs.vimUtils.buildVimPlugin {
# https://github.com/cljoly/telescope-repo.nvim
name = "telescope-repo.nvim";
src = pkgs.fetchFromGitHub {
owner = "cljoly";
repo = "telescope-repo.nvim";
rev = "a5395a4bf0fd742cc46b4e8c50e657062f548ba9";
sha256 = "sha256-cIovB45hfG4lDK0VBIgK94dk2EvGXZtfAJETkQ+lrcw=";
};
})
];
# https://github.com/nvim-telescope/telescope.nvim/issues/2806#issuecomment-1904877188
autoGroups.find_files_hijack_netrw.clear = true;
autoCmd = [
@ -70,13 +72,20 @@
vim.schedule(function()
-- Early return if netrw or not a directory
if vim.bo[0].filetype == "netrw" or vim.fn.isdirectory(vim.fn.expand("%:p")) == 0 then
return
return
end
vim.api.nvim_buf_set_option(0, "bufhidden", "wipe")
require("telescope.builtin").find_files({
cwd = vim.fn.expand("%:p:h"),
cwd = vim.fn.expand("%:p:h"),
find_command = {
"rg",
"--ignore",
"--hidden",
"--files",
"--glob=!.git/",
},
})
end)
end
@ -87,7 +96,7 @@
{
mode = "n";
key = "<leader>tf";
action = ":Telescope find_files<CR>";
action = "<CMD>Telescope find_files find_command=rg,--ignore,--hidden,--files,--glob=!.git/<CR>";
options = {
desc = "Find Files";
silent = true;
@ -150,7 +159,8 @@
{
mode = "n";
key = "<leader>tp";
action = ":Telescope repo list<CR>";
# action = ":Telescope repo list<CR>";
action = "<CMD>Telescope project display_type=full hide_workspace=true<CR>";
options = {
desc = "Projects";
silent = true;