Skip to content

Commit

Permalink
fix(telescope): only map Telescope's live_grep picker if rg is av…
Browse files Browse the repository at this point in the history
…ailable
  • Loading branch information
mehalter committed May 1, 2024
1 parent 3427172 commit 25a7ebf
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions lua/astronvim/plugins/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,17 @@ return {
maps.n["<Leader>fr"] = { function() require("telescope.builtin").registers() end, desc = "Find registers" }
maps.n["<Leader>ft"] =
{ function() require("telescope.builtin").colorscheme { enable_preview = true } end, desc = "Find themes" }
maps.n["<Leader>fw"] = { function() require("telescope.builtin").live_grep() end, desc = "Find words" }
maps.n["<Leader>fW"] = {
function()
require("telescope.builtin").live_grep {
additional_args = function(args) return vim.list_extend(args, { "--hidden", "--no-ignore" }) end,
}
end,
desc = "Find words in all files",
}
if vim.fn.executable "rg" == 1 then
maps.n["<Leader>fw"] = { function() require("telescope.builtin").live_grep() end, desc = "Find words" }
maps.n["<Leader>fW"] = {
function()
require("telescope.builtin").live_grep {
additional_args = function(args) return vim.list_extend(args, { "--hidden", "--no-ignore" }) end,
}
end,
desc = "Find words in all files",
}
end
maps.n["<Leader>ls"] = {
function()
if is_available "aerial.nvim" then
Expand Down

0 comments on commit 25a7ebf

Please sign in to comment.