Created
April 28, 2026 17:20
-
-
Save o-az/03cfd4a3d33b6faaf752c8f68f54314b to your computer and use it in GitHub Desktop.
Defined in ~/.config/fish/functions/lsgrep.fish
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Defined in ~/.config/fish/functions/lsgrep.fish | |
| function lsgrep --description 'Wildcard folder/file search' | |
| # Convert search to regex: change .X to \.X, ? to ., and space or * to .*? | |
| set -l needle (echo $argv|sed -E 's/\.([a-z0-9]+)$/\\\.\1/'|sed -E 's/\?/./'| sed -E 's/[ *]/.*?/g') | |
| command ag --hidden --depth 3 -SUg "$needle" 2>/dev/null | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment