diff --git a/nixos/nvim/plugins/dashboard.nix b/nixos/nvim/plugins/dashboard.nix index e20210a..f6c1c40 100644 --- a/nixos/nvim/plugins/dashboard.nix +++ b/nixos/nvim/plugins/dashboard.nix @@ -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"; diff --git a/nixos/nvim/plugins/telescope.nix b/nixos/nvim/plugins/telescope.nix index 46c6a91..28589f4 100644 --- a/nixos/nvim/plugins/telescope.nix +++ b/nixos/nvim/plugins/telescope.nix @@ -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 = "tf"; - action = ":Telescope find_files"; + action = "Telescope find_files find_command=rg,--ignore,--hidden,--files,--glob=!.git/"; options = { desc = "Find Files"; silent = true; @@ -150,7 +159,8 @@ { mode = "n"; key = "tp"; - action = ":Telescope repo list"; + # action = ":Telescope repo list"; + action = "Telescope project display_type=full hide_workspace=true"; options = { desc = "Projects"; silent = true;