dotfiles/nvim/lua/tel.lua
2022-02-13 21:02:44 -05:00

74 lines
1.6 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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
-- ]]