mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 05:28:49 +00:00
Paginating last command
Often, I want to paginate the command I just ran. Easy enough to <up><alt-p>, but this patch saves a keystroke.
This commit is contained in:
parent
d5e5878f6d
commit
37e0fbb5e4
1 changed files with 5 additions and 1 deletions
|
@ -5,9 +5,13 @@ function __fish_paginate -d "Paginate the current command using the users defaul
|
||||||
set cmd $PAGER
|
set cmd $PAGER
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if test -z (commandline -j)
|
||||||
|
commandline -a $history[1]
|
||||||
|
end
|
||||||
|
|
||||||
if commandline -j | string match -q -r -v "$cmd *\$"
|
if commandline -j | string match -q -r -v "$cmd *\$"
|
||||||
|
|
||||||
commandline -aj " ^&1 |$cmd;"
|
commandline -aj " ^&1 | $cmd;"
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue