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

35 lines
1.1 KiB
Lua
Raw Normal View History

2023-02-11 14:11:00 +01:00
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 = {
2023-02-25 07:47:44 +01:00
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"
2023-02-11 14:11:00 +01:00
}
}
}
telescope.load_extension('fzf')
telescope.load_extension('file_browser')
local map = vim.keymap.set
2023-02-25 07:47:44 +01:00
map('n', "<C-n>", "<cmd>Telescope file_browser<cr>")
map('n', "<C-t>", "<cmd>Telescope current_buffer_tags<cr>")
2023-02-11 14:11:00 +01:00
2023-02-25 07:47:44 +01:00
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>")