aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/__fish_paginate.fish
blob: 7887cf6b27fda00b084b63440b255efb13fb1236 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
function __fish_paginate -d "Paginate the current command using the users default pager"

	set -l cmd less
	if set -q PAGER
		set cmd $PAGER
	end

	if commandline -j|grep -v "$cmd *\$" >/dev/null

		commandline -aj " ^&1 |$cmd;"
	end

end