From 8c5295efe4e57d46130c5517b764fd4b1f063377 Mon Sep 17 00:00:00 2001 From: Michaƫl Ball Date: Thu, 5 Dec 2024 12:17:32 +0000 Subject: Telescope updates --- neovim/.config/nvim/lua/plugins/telescope.lua | 45 +++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) (limited to 'neovim/.config/nvim') diff --git a/neovim/.config/nvim/lua/plugins/telescope.lua b/neovim/.config/nvim/lua/plugins/telescope.lua index 6a81359..08729ca 100644 --- a/neovim/.config/nvim/lua/plugins/telescope.lua +++ b/neovim/.config/nvim/lua/plugins/telescope.lua @@ -1,13 +1,52 @@ return { { 'nvim-telescope/telescope.nvim', + tag = '0.1.8', dependencies = { - 'nvim-lua/plenary.nvim', + { + 'nvim-lua/plenary.nvim', + }, + { + "nvim-telescope/telescope-live-grep-args.nvim", + -- This will not install any breaking changes. + -- For major updates, this must be adjusted manually. + version = "^1.0.0", + }, }, + cmd = "Telescope", keys = { - { '', 'Telescope buffers', desc = 'Telescope buffers' }, + { '', 'Telescope buffers', desc = 'Telescope buffers' }, { '', 'Telescope find_files', desc = 'Telescope find files' }, - { '', 'Telescope live_grep', desc = 'Telescope live grep' }, + { '', 'Telescope live_grep', desc = 'Telescope live grep' }, }, + config = function() + local telescope = require("telescope") + local lga_actions = require("telescope-live-grep-args.actions") + + -- first setup telescope + telescope.setup({ + extensions = { + live_grep_args = { + auto_quoting = true, -- enable/disable auto-quoting + -- define mappings, e.g. + mappings = { -- extend mappings + i = { + [""] = lga_actions.quote_prompt(), + [""] = lga_actions.quote_prompt({ postfix = " --iglob " }), + -- freeze the current list and start a fuzzy search in the frozen list + [""] = lga_actions.to_fuzzy_refine, + }, + }, + -- ... also accepts theme settings, for example: + -- theme = "dropdown", -- use dropdown theme + -- theme = { }, -- use own theme spec + -- layout_config = { mirror=true }, -- mirror preview pane + } + } + }) + + -- then load the extension + telescope.load_extension("live_grep_args") + end }, } -- cgit v1.2.3