function keys --description 'Show keyboard shortcuts list' -a program function _print_shortcut -a shcut -a desc set_color green printf "%-12s" $shcut set_color normal printf " → %s\n" $desc end if test -z "$program" set program 'fish' end echo echo \# $program echo printf "%-12s %s\n" 'Shortcut' 'Description' echo switch $program case 'fish' _print_shortcut 'CTRL+x' 'quit fish' _print_shortcut 'CTRL+l' 'clear screen' _print_shortcut 'ALT+left' 'go to the previous directory' _print_shortcut 'ALT+right' 'go to the next directory' _print_shortcut 'ALT+r' 'repeat last command' _print_shortcut 'ALT+s' 'prepend super user command' case '*' echo 'Unknown program.' end echo functions -e _print_shortcut end