From 18125a817d8033216d8ffb12ba2aad87e85110c6 Mon Sep 17 00:00:00 2001 From: Deposite Pirate Date: Sat, 14 Feb 2026 23:16:00 +0100 Subject: Quick help new file: functions/keys.fish --- functions/keys.fish | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 functions/keys.fish diff --git a/functions/keys.fish b/functions/keys.fish new file mode 100644 index 0000000..487e384 --- /dev/null +++ b/functions/keys.fish @@ -0,0 +1,34 @@ +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 -- cgit v1.3.1