dotfiles/dot_config/nvim/after/plugin/telescope.lua

35 lines
1.1 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 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>b", "<cmd>Telescope buffers<cr>")
map('n', "<leader>h", "<cmd>Telescope help_tags<cr>")
map('n', "z=", "<cmd>Telescope spell_suggest<cr>")