mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 21:44:16 +00:00
Make the Alt-p keybinding respect the PAGER variable
darcs-hash:20071006103231-75c98-59ef22ad49526f52cff8a97d9fac9f003af19213.gz
This commit is contained in:
parent
9299515f3e
commit
3ca3b6209d
2 changed files with 15 additions and 2 deletions
13
share/functions/__fish_paginate.fish
Normal file
13
share/functions/__fish_paginate.fish
Normal 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
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue