35 lines
1.1 KiB
Lua
35 lines
1.1 KiB
Lua
|
local ok, telescope = pcall(require, 'telescope')
|
|||
|
if not ok then
|
|||
|
return
|
|||
|
end
|
|||
|
|
|||
|
telescope.setup {
|
|||
|
defaults = {
|
|||
|
prompt_prefix = '❯ ',
|
|||
|
selection_caret = '❯ ',
|
|||
|
layout_config = { horizontal = { preview_width = 0.5 } },
|
|||
|
file_ignore_patterns = { 'node_modules/.*' },
|
|||
|
},
|
|||
|
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"
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
telescope.load_extension('fzf')
|
|||
|
telescope.load_extension('file_browser')
|
|||
|
|
|||
|
local map = vim.keymap.set
|
|||
|
map('n',"<C-n>", "<cmd>Telescope file_browser<cr>")
|
|||
|
map('n',"<C-t>", "<cmd>Telescope current_buffer_tags<cr>")
|
|||
|
|
|||
|
map('n',"<leader>e", "<cmd>Telescope find_files<cr>")
|
|||
|
map('n',"<leader>f", "<cmd>Telescope live_grep<cr>")
|
|||
|
map('n',"<leader>g", "<cmd>Telescope grep_string<cr>")
|
|||
|
map('n',"<leader>b", "<cmd>Telescope buffers<cr>")
|
|||
|
map('n',"<leader>h", "<cmd>Telescope help_tags<cr>")
|