74 lines
1.6 KiB
Lua
74 lines
1.6 KiB
Lua
|
|
|||
|
local telescope = require('telescope')
|
|||
|
|
|||
|
telescope.setup({
|
|||
|
defaults = {
|
|||
|
file_ignore_patterns = {'.git'},
|
|||
|
mappings = {
|
|||
|
i = {
|
|||
|
['<C-o>'] = { '<Esc>', type = 'command' },
|
|||
|
['<Esc>'] = 'close',
|
|||
|
|
|||
|
['<C-s>'] = 'select_horizontal',
|
|||
|
},
|
|||
|
n = {
|
|||
|
q = 'close',
|
|||
|
|
|||
|
['<C-o>'] = { '<Nop>', type = 'command' },
|
|||
|
|
|||
|
['<C-s>'] = 'select_horizontal',
|
|||
|
},
|
|||
|
},
|
|||
|
sorting_strategy = 'ascending',
|
|||
|
layout_config = {
|
|||
|
prompt_position = 'top',
|
|||
|
},
|
|||
|
prompt_prefix = '❯ ',
|
|||
|
selection_caret = '❯ ',
|
|||
|
multi_icon = '●',
|
|||
|
},
|
|||
|
pickers = {
|
|||
|
buffers = {
|
|||
|
mappings = {
|
|||
|
n = {
|
|||
|
dd = 'delete_buffer',
|
|||
|
},
|
|||
|
},
|
|||
|
},
|
|||
|
find_files = {
|
|||
|
hidden = true,
|
|||
|
},
|
|||
|
lsp_code_actions = {
|
|||
|
initial_mode = 'normal',
|
|||
|
},
|
|||
|
lsp_range_code_actions = {
|
|||
|
initial_mode = 'normal',
|
|||
|
},
|
|||
|
},
|
|||
|
})
|
|||
|
|
|||
|
telescope.load_extension('fzf')
|
|||
|
|
|||
|
local map = vim.api.nvim_set_keymap
|
|||
|
|
|||
|
map('n', '<Leader>pf', '<Cmd>Telescope find_files<CR>', {noremap = true})
|
|||
|
map('n', '<Leader>pb', '<Cmd>Telescope buffers<CR>', {noremap = true})
|
|||
|
map('n', '<Leader>po', '<Cmd>Telescope lsp_document_symbols<CR>', {noremap = true})
|
|||
|
map('n', '<Leader>p', ':Telescope ', {noremap = true})
|
|||
|
map('n', '<Leader>p ', ':Telescope ', {noremap = true})
|
|||
|
|
|||
|
map('n', '<Leader>.', '<Cmd>Telescope lsp_code_actions<CR>', {noremap = true})
|
|||
|
|
|||
|
-- vim.cmd [[
|
|||
|
-- function! s:telescope_hlsetup() abort
|
|||
|
-- highlight link TelescopeBorder NonText
|
|||
|
-- highlight link TelescopeTitle NonText
|
|||
|
-- endfunction
|
|||
|
-- call s:telescope_hlsetup()
|
|||
|
-- augroup telescope_hlsetup
|
|||
|
-- au!
|
|||
|
-- au ColorScheme * call s:telescope_hlsetup()
|
|||
|
-- augroup END
|
|||
|
-- ]]
|
|||
|
|