aboutsummaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorDeposite Pirate2026-02-14 23:16:00 +0100
committerDeposite Pirate2026-02-14 23:16:00 +0100
commit18125a817d8033216d8ffb12ba2aad87e85110c6 (patch)
tree4051938f486bc9c0d3f9019f75df1b895328e913 /functions
parent5ae2e982d3a771c6d94d287c1856c5141681d0d7 (diff)
Quick help
new file: functions/keys.fish
Diffstat (limited to 'functions')
-rw-r--r--functions/keys.fish34
1 files changed, 34 insertions, 0 deletions
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