1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
return {
{
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
{
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
cond = vim.fn.executable("make") == 1
},
},
config = function()
require('telescope').setup({
extensions = {
fzf = {
fuzzy = true, -- false will only do exact matching
override_generic_sorter = true,
override_file_sorter = true,
case_mode = "smart_case",
}
}
})
-- Enable telescope fzf native, if installed
pcall(require("telescope").load_extension, "fzf")
local map = require("helpers.keys").map
map("n", "<leader>fr", require("telescope.builtin").oldfiles, "recently opened")
map("n", "<leader><space>", require("telescope.builtin").buffers, "open buffers")
map("n", "<leader>/", function()
-- You can pass additional configuration to telescope to change theme, layout, etc.
require("telescope.builtin").current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
winblend = 10,
previewer = false,
}))
end, "search in current buffer")
map("n", "<leader>sf", require("telescope.builtin").find_files, "files")
map("n", "<leader>sh", require("telescope.builtin").help_tags, "help")
map("n", "<leader>sw", require("telescope.builtin").grep_string, "current word")
map("n", "<leader>sg", require("telescope.builtin").live_grep, "grep")
map("n", "<leader>sd", require("telescope.builtin").diagnostics, "diagnostics")
end,
},
}
|