summaryrefslogtreecommitdiff
path: root/lua/plugins/core/telescope.lua
blob: 15604424ada0eae5b5248f9b7a3b8ee0f7ad180a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
return {
   {
      "nvim-telescope/telescope.nvim",
      config = function()
         require("telescope").load_extension("file_browser")
      end,
      dependencies = {
         "nvim-lua/plenary.nvim",
         "nvim-telescope/telescope-file-browser.nvim",
      },
   },

   {
      "folke/which-key.nvim",
      opts = function(_, opts)
         if type(opts) == "table" then
            opts.b = opts.b or {}
            opts.f = opts.f or {}

            opts.b["b"] = { "<cmd>Telescope buffers<cr>", "All" }
            opts.f["f"] = { "<cmd>Telescope find_files<cr>", "Find" }
            opts.f["g"] = {
               function()
                  require("telescope.builtin").live_grep({
                     additional_args = { "--hidden" },
                  })
               end,
               "Grep",
            }
            opts.f["b"] = { "<cmd>Telescope file_browser<cr>", "Browse" }
         end
      end,
   },
}