From 37e0fbb5e4f0fbf9e62527094e451f7d8937e6f0 Mon Sep 17 00:00:00 2001 From: Judson Date: Wed, 25 Oct 2017 16:13:42 -0700 Subject: [PATCH] Paginating last command Often, I want to paginate the command I just ran. Easy enough to , but this patch saves a keystroke. --- share/functions/__fish_paginate.fish | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/share/functions/__fish_paginate.fish b/share/functions/__fish_paginate.fish index 95390ac53..848392b4e 100644 --- a/share/functions/__fish_paginate.fish +++ b/share/functions/__fish_paginate.fish @@ -5,9 +5,13 @@ function __fish_paginate -d "Paginate the current command using the users defaul set cmd $PAGER end + if test -z (commandline -j) + commandline -a $history[1] + end + if commandline -j | string match -q -r -v "$cmd *\$" - commandline -aj " ^&1 |$cmd;" + commandline -aj " ^&1 | $cmd;" end end