2023-02-26 13:29:03 +00:00
|
|
|
-- 模糊搜索
|
|
|
|
local telescope = require("telescope")
|
|
|
|
local actions = require("telescope.actions")
|
|
|
|
local themes = require("telescope.themes")
|
|
|
|
telescope.setup({
|
|
|
|
defaults = themes.get_dropdown({
|
|
|
|
path_display = { "absolute" },
|
|
|
|
file_ignore_patterns = { ".git/", "node_modules" },
|
|
|
|
mappings = {
|
|
|
|
i = {
|
|
|
|
["<Down>"] = actions.cycle_history_next,
|
|
|
|
["<Up>"] = actions.cycle_history_prev,
|
|
|
|
["<C-n>"] = actions.cycle_history_next,
|
|
|
|
["<C-p>"] = actions.cycle_history_prev,
|
|
|
|
["<C-j>"] = actions.move_selection_next,
|
|
|
|
["<C-k>"] = actions.move_selection_previous,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
extensions = {
|
|
|
|
fzf = {
|
|
|
|
fuzzy = true, -- false will only do exact matching
|
|
|
|
override_generic_sorter = true, -- override the generic sorter
|
|
|
|
override_file_sorter = true, -- override the file sorter
|
|
|
|
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
|
|
|
|
-- the default case_mode is "smart_case"
|
|
|
|
},
|
|
|
|
["ui-select"] = {
|
|
|
|
require("telescope.themes").get_dropdown({
|
|
|
|
-- even more opts
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
pickers = {
|
|
|
|
find_files = {
|
|
|
|
hidden = true,
|
|
|
|
no_ignore = true,
|
|
|
|
no_ignore_parent = true,
|
|
|
|
},
|
|
|
|
buffers = {
|
|
|
|
sort_mru = true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
telescope.load_extension("ui-select")
|
2023-03-31 18:57:27 +00:00
|
|
|
if vim.loop.os_uname().sysname == "Linux" then
|
|
|
|
telescope.load_extension("fzf")
|
|
|
|
end
|