Skip to content

Commit

Permalink
perf(plugin):add telescope-live-grep-args
Browse files Browse the repository at this point in the history
  • Loading branch information
liubang committed Jul 6, 2024
1 parent dd7658e commit 6472391
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lua/plugins/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ local M = {
dependencies = {
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
{ "nvim-telescope/telescope-ui-select.nvim" },
{ "nvim-telescope/telescope-live-grep-args.nvim" },
{ "debugloop/telescope-undo.nvim" },
{ "skywind3000/asynctasks.vim" },
},
keys = {
{ "<Leader>ff", "<CMD>Telescope find_files<CR>", mode = { "n" }, desc = "List files" },
{ "<Leader>rf", "<CMD>Telescope oldfiles<CR>", mode = { "n" }, desc = "List recent files" },
{ "<Leader>ag", "<CMD>Telescope live_grep<CR>", mode = { "n" }, desc = "Grep in files" },
{ "<Leader>ag", "<CMD>Telescope live_grep_args<CR>", mode = { "n" }, desc = "Grep in files" },
{
"<Leader>Ag",
"<CMD>Telescope grep_string<CR>",
Expand Down Expand Up @@ -141,6 +142,15 @@ function M.config()
lsp_workspace_symbols = { path_display = { "shorten" } },
}, --}}}
extensions = { --{{{
live_grep_args = {
preview = true,
mappings = { -- extend mappings
i = {
["<C-g>"] = require("telescope-live-grep-args.actions").quote_prompt({ postfix = " --iglob " }),
["<C-t>"] = require("telescope-live-grep-args.actions").quote_prompt({ postfix = " -t " }),
},
},
},
fzf = {
fuzzy = false,
override_generic_sorter = true,
Expand All @@ -150,6 +160,7 @@ function M.config()
}, --}}}
})

telescope.load_extension("live_grep_args")
telescope.load_extension("ui-select")
telescope.load_extension("fzf")
telescope.load_extension("bazel")
Expand Down

0 comments on commit 6472391

Please sign in to comment.