Skip to content

Instantly share code, notes, and snippets.

@monakez
Forked from RichardBronosky/less
Created December 21, 2022 12:22
Show Gist options
  • Save monakez/00cfa58c3a4020d074d68001dcd204a1 to your computer and use it in GitHub Desktop.
Save monakez/00cfa58c3a4020d074d68001dcd204a1 to your computer and use it in GitHub Desktop.
A vim wrapper that allow you to use it for a pager, man reader, etc.
#!/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