local telescope = require('telescope') local actions = require('telescope.actions') local icons = require('lib.icons') local flash = require('plugins.tools.telescope-custom').flash local multi_open = require('plugins.tools.telescope-custom').multi_open telescope.setup({ defaults = { layout_config = { height = 0.8, width = 0.9, prompt_position = 'top', bottom_pane = { height = 0.5, preview_width = 0.6, preview_cutoff = 120, }, center = { height = 0.4, preview_cutoff = 40, }, cursor = { preview_cutoff = 40, preview_width = 0.6, }, horizontal = { preview_width = 0.6, preview_cutoff = 120, }, vertical = { preview_cutoff = 40, }, }, prompt_prefix = icons.ui.Telescope .. icons.ui.ChevronRight, selection_caret = icons.ui.Play, multi_icon = icons.ui.Check, path_display = { 'smart' }, -- path_display = { filename_first = { reverse_directories = false } }, sorting_strategy = 'ascending', mappings = { i = { [''] = actions.close, [''] = actions.cycle_history_next, [''] = actions.cycle_history_prev, [''] = actions.move_selection_next, [''] = actions.move_selection_previous, [''] = actions.close, [''] = actions.move_selection_next, [''] = actions.move_selection_previous, [''] = multi_open, [''] = actions.select_horizontal, [''] = actions.select_vertical, [''] = actions.select_horizontal, [''] = actions.select_vertical, [''] = actions.select_tab, [''] = flash, [''] = actions.preview_scrolling_up, [''] = actions.preview_scrolling_down, [''] = actions.results_scrolling_up, [''] = actions.results_scrolling_down, [''] = actions.toggle_selection + actions.move_selection_worse, [''] = actions.toggle_selection + actions.move_selection_better, [''] = actions.send_to_qflist + actions.open_qflist, [''] = actions.send_selected_to_qflist + actions.open_qflist, [''] = actions.complete_tag, }, n = { ['q'] = actions.close, [''] = actions.close, [''] = multi_open, [''] = actions.select_horizontal, [''] = actions.select_vertical, [''] = actions.select_tab, ['s'] = flash, [''] = actions.toggle_selection + actions.move_selection_worse, [''] = actions.toggle_selection + actions.move_selection_better, [''] = actions.send_to_qflist + actions.open_qflist, [''] = actions.send_selected_to_qflist + actions.open_qflist, ['j'] = actions.move_selection_next, ['k'] = actions.move_selection_previous, ['H'] = actions.move_to_top, ['M'] = actions.move_to_middle, ['L'] = actions.move_to_bottom, [''] = actions.move_selection_next, [''] = actions.move_selection_previous, ['gg'] = actions.move_to_top, ['G'] = actions.move_to_bottom, [''] = actions.preview_scrolling_up, [''] = actions.preview_scrolling_down, [''] = actions.results_scrolling_up, [''] = actions.results_scrolling_down, ['?'] = actions.which_key, }, }, }, extensions = { fzf = { fuzzy = true, override_generic_sorter = true, override_file_sorter = true, case_mode = 'smart_case', }, undo = { use_delta = true, use_custom_command = nil, side_by_side = true, vim_diff_opts = { ctxlen = vim.o.scrolloff * 2, }, entry_format = 'state #$ID, $STAT, $TIME', -- time_format = '%d %b %H:%M', saved_only = false, layout_strategy = 'vertical', layout_config = { preview_height = 0.7, }, mappings = { i = { [''] = require('telescope-undo.actions').yank_additions, [''] = require('telescope-undo.actions').yank_deletions, [''] = require('telescope-undo.actions').restore, }, }, }, }, }) telescope.load_extension('fzf') telescope.load_extension('undo') telescope.load_extension('marks_nvim') telescope.load_extension('refactoring')