-
-
Save RichardBronosky/94024fac52780e03c936589f4c9ab914 to your computer and use it in GitHub Desktop.
A vim wrapper that allow you to use it for a pager, man reader, etc.
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
| #!/usr/bin/env bash | |
| set -eu | |
| cache_file="/tmp/pager.cache" | |
| [[ ! -p "$cache_file" ]] && touch "$cache_file" && trap "rm $cache_file" 0 | |
| cat > "$cache_file" | |
| vim -R -c "terminal cat $cache_file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is awesome 🥇 , thanks so much. I was having issue reading logs from Spacelift.io. I further simplified the command into an alias in my terminal by adding
less() { vim -R --not-a-term -c "terminal cat $@" -c "only" }to my .zshrc profile. :