switch from telescope-repo
to telescope-project
This commit is contained in:
parent
2b0bdc994a
commit
eae5d72091
2 changed files with 30 additions and 20 deletions
|
@ -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";
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue