diff options
Diffstat (limited to '.config/nvim/lua/plugins/telescope.lua')
-rw-r--r-- | .config/nvim/lua/plugins/telescope.lua | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index ecea32b..be6fdd7 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua | |||
@@ -1,6 +1,7 @@ | |||
1 | return { | 1 | return { |
2 | { | 2 | { |
3 | "nvim-telescope/telescope.nvim", | 3 | "nvim-telescope/telescope.nvim", |
4 | priority = 500, | ||
4 | dependencies = { | 5 | dependencies = { |
5 | "nvim-lua/plenary.nvim", | 6 | "nvim-lua/plenary.nvim", |
6 | { | 7 | { |
@@ -8,38 +9,45 @@ return { | |||
8 | build = "make", | 9 | build = "make", |
9 | cond = vim.fn.executable("make") == 1 | 10 | cond = vim.fn.executable("make") == 1 |
10 | }, | 11 | }, |
12 | "gbprod/yanky.nvim", | ||
11 | }, | 13 | }, |
14 | lazy = false, | ||
12 | config = function() | 15 | config = function() |
13 | require('telescope').setup({ | 16 | require('telescope').setup({ |
17 | defaults = { | ||
18 | path_display = { "truncate" }, | ||
19 | }, | ||
14 | extensions = { | 20 | extensions = { |
15 | fzf = { | 21 | fzf = { |
16 | fuzzy = true, -- false will only do exact matching | 22 | fuzzy = true, -- false will only do exact matching |
17 | override_generic_sorter = true, | 23 | override_generic_sorter = true, |
18 | override_file_sorter = true, | 24 | override_file_sorter = true, |
19 | case_mode = "smart_case", | 25 | case_mode = "smart_case", |
20 | } | 26 | }, |
21 | } | 27 | }, |
22 | }) | 28 | }) |
23 | -- Enable telescope fzf native, if installed | 29 | -- Enable telescope fzf native, if installed |
24 | pcall(require("telescope").load_extension, "fzf") | 30 | pcall(require("telescope").load_extension, "fzf") |
25 | 31 | ||
26 | local map = require("helpers.keys").map | 32 | local map = require("helpers.keys").map |
27 | 33 | ||
28 | map("n", "<leader>fr", require("telescope.builtin").oldfiles, "recently opened") | 34 | map("n", "<leader>fr", require("telescope.builtin").oldfiles, "ðŸ”: recently opened") |
29 | map("n", "<leader><space>", require("telescope.builtin").buffers, "open buffers") | 35 | map("n", "<leader><space>", require("telescope.builtin").buffers, "ðŸ”: open buffers") |
30 | map("n", "<leader>/", function() | 36 | map("n", "<leader>/", function() |
31 | -- You can pass additional configuration to telescope to change theme, layout, etc. | 37 | -- you can pass additional configuration to telescope to change theme, layout, etc. |
32 | require("telescope.builtin").current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({ | 38 | require("telescope.builtin").current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({ |
33 | winblend = 10, | 39 | winblend = 10, |
34 | previewer = false, | 40 | previewer = false, |
35 | })) | 41 | })) |
36 | end, "search in current buffer") | 42 | end, "ðŸ”: search in current buffer") |
37 | 43 | ||
38 | map("n", "<leader>sf", require("telescope.builtin").find_files, "files") | 44 | map("n", "<leader>sf", require("telescope.builtin").find_files, "ðŸ”: find files") |
39 | map("n", "<leader>sh", require("telescope.builtin").help_tags, "help") | 45 | map("n", "<leader>sh", require("telescope.builtin").help_tags, "ðŸ”: help") |
40 | map("n", "<leader>sw", require("telescope.builtin").grep_string, "current word") | 46 | map("n", "<leader>sw", require("telescope.builtin").grep_string, "ðŸ”: current word") |
41 | map("n", "<leader>sg", require("telescope.builtin").live_grep, "grep") | 47 | map("n", "<leader>sg", require("telescope.builtin").live_grep, "ðŸ”: live grep") |
42 | map("n", "<leader>sd", require("telescope.builtin").diagnostics, "diagnostics") | 48 | map("n", "<leader>sd", require("telescope.builtin").diagnostics, "ðŸ”: diagnostics") |
49 | require("telescope").load_extension("yank_history") | ||
50 | map("n", "<leader>sp", require("telescope").extensions.yank_history.yank_history, "ðŸ”: yank history") | ||
43 | end, | 51 | end, |
44 | }, | 52 | }, |
45 | } | 53 | } |