Last active
April 22, 2026 17:26
-
-
Save o-az/6ac2cf66b96b5d6baedf95a0f04157be to your computer and use it in GitHub Desktop.
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