Skip to content

Add hidden file and directory filter option toggle to grep_string #3454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

seffradev
Copy link

Description

Add option hidden for toggling if hidden files and directories should appear when running grep_string from builtin.files.

Fixes #3453

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

local telescope = require "telescope"
local builtin = require "telescope.builtin"

vim.keymap.set("n", "<space>fg", function()
  builtin.grep_string {
    search = vim.fn.input "grep: ",
    hidden = true,
  }
end, { desc = "Grep files in current working directory" })

After running <space>fg and typing a string to grep for in a directory containing hidden objects, they appear. Likewise, commenting out the hidden = true, the hidden files and directories do not appear.

Configuration:

  • Neovim version (nvim --version):
NVIM v0.11.0-dev-1315+g668d2569b4
Build type: RelWithDebInfo
LuaJIT 2.1.1732813678
  • Operating system and version:
OS: Arch linux
Kernel: 6.13.8-arch1-1

Checklist:

  • My code follows the style guidelines of this project (stylua)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (lua annotations)

@seffradev seffradev changed the title Add hidden file and directory filter option toggle to grep_string Add hidden file and directory filter option toggle to grep_string Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option for searching hidden files and directories in grep_string
1 participant