aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/fish_default_key_bindings.fish
diff options
context:
space:
mode:
authorGravatar Konrad Borowski <x.fix@o2.pl>2014-09-28 11:09:14 +0200
committerGravatar Konrad Borowski <x.fix@o2.pl>2014-09-28 11:12:25 +0200
commit26051ea1984ee6f6329d46eb3c001a5d2bfe1bae (patch)
treee1952aa36e7918d92f80fc053c4b09dc46909461 /share/functions/fish_default_key_bindings.fish
parentb00cbae4b52ee3dbdef7abb064004b05e6ec9e3a (diff)
Add Meta+H as keybinding for man page.
Apparently, in zsh, Meta+H can be used to display the manpage for the current command. This commit adds this zsh feature to fish shell. The F1 keybinding is left, although it's now secondary according to fish help, as some terminal emulators don't let the user press F1 key.
Diffstat (limited to 'share/functions/fish_default_key_bindings.fish')
-rw-r--r--share/functions/fish_default_key_bindings.fish5
1 files changed, 3 insertions, 2 deletions
diff --git a/share/functions/fish_default_key_bindings.fish b/share/functions/fish_default_key_bindings.fish
index d33f7b53..120a3573 100644
--- a/share/functions/fish_default_key_bindings.fish
+++ b/share/functions/fish_default_key_bindings.fish
@@ -111,8 +111,9 @@ function fish_default_key_bindings -d "Default (Emacs-like) key bindings for fis
bind \ed forward-kill-word
bind \ed kill-word
- # Allow reading manpages by pressing F1
- bind $argv -k f1 'man (basename (commandline -po; echo)[1]) ^/dev/null; or echo -n \a'
+ # Allow reading manpages by pressing F1 (many GUI applications) or Alt+h (like in zsh)
+ bind $argv -k f1 __fish_man_page
+ bind $argv \eh __fish_man_page
# This will make sure the output of the current command is paged using the less pager when you press Meta-p
bind $argv \ep '__fish_paginate'