Christian Chiarulli 2 lat temu
rodzic
commit
552197499c
1 zmienionych plików z 52 dodań i 47 usunięć
  1. 52 47
      lua/lvim/core/telescope.lua

+ 52 - 47
lua/lvim/core/telescope.lua

@@ -1,5 +1,53 @@
 local M = {}
 
+local pickers = {
+  find_files = {
+    theme = "dropdown",
+    hidden = true,
+    previewer = false,
+  },
+  live_grep = {
+    --@usage don't include the filename in the search results
+    only_sort_text = true,
+    theme = "dropdown",
+  },
+  grep_string = {
+    only_sort_text = true,
+    theme = "dropdown",
+  },
+  buffers = {
+    theme = "dropdown",
+    previewer = false,
+    initial_mode = "normal",
+  },
+  planets = {
+    show_pluto = true,
+    show_moon = true,
+  },
+  git_files = {
+    theme = "dropdown",
+    hidden = true,
+    previewer = false,
+    show_untracked = true,
+  },
+  lsp_references = {
+    theme = "dropdown",
+    initial_mode = "normal",
+  },
+  lsp_definitions = {
+    theme = "dropdown",
+    initial_mode = "normal",
+  },
+  lsp_declarations = {
+    theme = "dropdown",
+    initial_mode = "normal",
+  },
+  lsp_implementations = {
+    theme = "dropdown",
+    initial_mode = "normal",
+  },
+}
+
 function M.config()
   -- Define this minimal config so that it's available if telescope is not yet available.
 
@@ -65,6 +113,7 @@ function M.config()
           ["dd"] = require("telescope.actions").delete_buffer,
         },
       },
+      pickers = pickers,
       file_ignore_patterns = {},
       path_display = { "smart" },
       winblend = 0,
@@ -73,53 +122,7 @@ function M.config()
       color_devicons = true,
       set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil,
     },
-    pickers = {
-      find_files = {
-        theme = "dropdown",
-        hidden = true,
-        previewer = false,
-      },
-      live_grep = {
-        --@usage don't include the filename in the search results
-        only_sort_text = true,
-        theme = "dropdown",
-      },
-      grep_string = {
-        only_sort_text = true,
-        theme = "dropdown",
-      },
-      buffers = {
-        theme = "dropdown",
-        previewer = false,
-        initial_mode = "normal",
-      },
-      planets = {
-        show_pluto = true,
-        show_moon = true,
-      },
-      git_files = {
-        theme = "dropdown",
-        hidden = true,
-        previewer = false,
-        show_untracked = true,
-      },
-      lsp_references = {
-        theme = "dropdown",
-        initial_mode = "normal",
-      },
-      lsp_definitions = {
-        theme = "dropdown",
-        initial_mode = "normal",
-      },
-      lsp_declarations = {
-        theme = "dropdown",
-        initial_mode = "normal",
-      },
-      lsp_implementations = {
-        theme = "dropdown",
-        initial_mode = "normal",
-      },
-    },
+    pickers = pickers,
     extensions = {
       fzf = {
         fuzzy = true, -- false will only do exact matching
@@ -157,8 +160,10 @@ function M.setup()
         ["<C-n>"] = actions.move_selection_next,
         ["<C-p>"] = actions.move_selection_previous,
         ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
+        ["dd"] = require("telescope.actions").delete_buffer,
       },
     },
+    pickers = pickers,
   }, lvim.builtin.telescope)
 
   local telescope = require "telescope"