This repository has been archived on 2024-04-07. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/dotfiles/scripts/kak-pager

16 lines
278 B
Bash
Executable File

#!/bin/sh
f=$(cat)
if test $(tput lines) -lt $(printf "%s\n" "$f" | wc -l)
then
printf "%s\n" "$f" | kak -e '
exec <a-o>
map global normal q :q<ret>;
rmhl global/number-lines;
set global scrolloff 10,0;
'
else
printf "%s\n" "$f"
fi