Last active
March 21, 2023 17:13
-
-
Save robert-saramet/a5c6cc5d1d74529cb738b0b27de9349c to your computer and use it in GitHub Desktop.
Fish command to print all files in directory using bat. Unorthodox code.
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
| function batdir --description 'Print all files in directory using bat' | |
| if not count $argv > /dev/null | |
| set path . | |
| else | |
| set path (string trim -r -c / $argv) | |
| end | |
| for file in $path/* | |
| bat -P $file 2> /dev/null | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment