generated from 2KAbhishek/bare-minimum
-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathtelescope.lua
146 lines (129 loc) Β· 5.2 KB
/
telescope.lua
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
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 = {
['<esc>'] = actions.close,
['<C-n>'] = actions.cycle_history_next,
['<C-p>'] = actions.cycle_history_prev,
['<C-j>'] = actions.move_selection_next,
['<C-k>'] = actions.move_selection_previous,
['<C-c>'] = actions.close,
['<Down>'] = actions.move_selection_next,
['<Up>'] = actions.move_selection_previous,
['<CR>'] = multi_open,
['<C-x>'] = actions.select_horizontal,
['<C-CR>'] = actions.select_vertical,
['<S-CR>'] = actions.select_horizontal,
['<C-v>'] = actions.select_vertical,
['<C-t>'] = actions.select_tab,
['<C-s>'] = flash,
['<C-u>'] = actions.preview_scrolling_up,
['<C-d>'] = actions.preview_scrolling_down,
['<PageUp>'] = actions.results_scrolling_up,
['<PageDown>'] = actions.results_scrolling_down,
['<Tab>'] = actions.toggle_selection + actions.move_selection_worse,
['<S-Tab>'] = actions.toggle_selection + actions.move_selection_better,
['<C-q>'] = actions.send_to_qflist + actions.open_qflist,
['<M-q>'] = actions.send_selected_to_qflist + actions.open_qflist,
['<C-l>'] = actions.complete_tag,
},
n = {
['q'] = actions.close,
['<esc>'] = actions.close,
['<CR>'] = multi_open,
['<C-x>'] = actions.select_horizontal,
['<C-v>'] = actions.select_vertical,
['<C-t>'] = actions.select_tab,
['s'] = flash,
['<Tab>'] = actions.toggle_selection + actions.move_selection_worse,
['<S-Tab>'] = actions.toggle_selection + actions.move_selection_better,
['<C-q>'] = actions.send_to_qflist + actions.open_qflist,
['<M-q>'] = 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,
['<Down>'] = actions.move_selection_next,
['<Up>'] = actions.move_selection_previous,
['gg'] = actions.move_to_top,
['G'] = actions.move_to_bottom,
['<C-u>'] = actions.preview_scrolling_up,
['<C-d>'] = actions.preview_scrolling_down,
['<PageUp>'] = actions.results_scrolling_up,
['<PageDown>'] = 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 = {
['<S-cr>'] = require('telescope-undo.actions').yank_additions,
['<C-cr>'] = require('telescope-undo.actions').yank_deletions,
['<cr>'] = require('telescope-undo.actions').restore,
},
},
},
},
})
telescope.load_extension('fzf')
telescope.load_extension('undo')
telescope.load_extension('marks_nvim')
telescope.load_extension('refactoring')