feat: pickers (#3053)

This commit is contained in:
Christian Chiarulli 2022-09-20 20:34:51 -04:00 committed by GitHub
parent f34dbc94c2
commit 552197499c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"