Created
November 26, 2021 13:27
-
-
Save mpvosseller/a6327ec8e9870decd61e0c3e6f568402 to your computer and use it in GitHub Desktop.
txt-preview - function to open text from stardard-input in Preview
This file contains 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 to open text from stardard-input in Preview | |
## inspired by the `man-preview` function of Oh My Zsh that opens any man page in Preview https://github.com/ohmyzsh/ohmyzsh/blob/b60b3f184275c39800dd7284d6904fcf295b3956/plugins/macos/macos.plugin.zsh#L221 | |
## requires enscript: `brew install enscript` | |
## example usage: | |
## echo "hello world" | txt-preview | |
function txt-preview() { | |
enscript -q -B -p- | open -f -a Preview | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment