Make the Alt-p keybinding respect the PAGER variable

darcs-hash:20071006103231-75c98-59ef22ad49526f52cff8a97d9fac9f003af19213.gz
This commit is contained in:
liljencrantz 2007-10-06 20:32:31 +10:00
parent 9299515f3e
commit 3ca3b6209d
2 changed files with 15 additions and 2 deletions

View file

@ -0,0 +1,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 "|$cmd;"
end
end

View file

@ -85,7 +85,7 @@ function fish_default_key_bindings -d "Default (Emacs-like) key bindings for fis
bind \cd delete-or-exit
# This will make sure the output of the current command is paged using the less pager when you press Meta-p
bind \ep 'if commandline -j|grep -v "less *\$" >/dev/null; commandline -aj "|less;"; end'
bind \ep '__fish_paginate'
end