Skip to content

Instantly share code, notes, and snippets.

@mcejp
Created November 6, 2018 14:19
Show Gist options
  • Save mcejp/ea94ec2afc8487f40792cb57d52643ec to your computer and use it in GitHub Desktop.
Save mcejp/ea94ec2afc8487f40792cb57d52643ec to your computer and use it in GitHub Desktop.
Configure fish to display help for keybinds on startup
echo "• Tab completes the current token. Shift Tab completes the current token and starts the pager's search mode.
• Alt-← and Alt-→ move the cursor one word left or right, or moves forward/backward in the directory history if the command line is empty. If the cursor is already at the end of the line, and an autosuggestion is available, Alt-→ (or Alt-F) accepts the first word in the suggestion.
• ↑ and ↓ (or Ctrl-P and Ctrl-N for emacs aficionados) search the command history for the previous/next command containing the string that was specified on the commandline before the search was started. If the commandline was empty when the search started, all commands match. See the history section for more information on history searching.
• Alt-↑ and Alt-↓ search the command history for the previous/next token containing the token under the cursor before the search was started. If the commandline was not on a token when the search started, all tokens match. See the history section for more information on history searching.
• Ctrl-C cancels the entire line.
• Ctrl-D delete one character to the right of the cursor. If the command line is empty, Ctrl-D will exit fish.
• Ctrl-U moves contents from the beginning of line to the cursor to the killring.
• Ctrl-L clears and repaints the screen.
• Ctrl-W moves the previous path component (everything up to the previous "/") to the killring.
• Ctrl-X copies the current buffer to the system's clipboard, Ctrl-V inserts the clipboard contents.
• Alt-d moves the next word to the killring.
• Alt-h (or F1) shows the manual page for the current command, if one exists.
• Alt-l lists the contents of the current directory, unless the cursor is over a directory argument, in which case the contents of that directory will be listed.
• Alt-p adds the string '| less;' to the end of the job under the cursor. The result is that the output of the command will be paged.
• Alt-w prints a short description of the command under the cursor.
• Alt-e edit the current command line in an external editor. The editor is chosen from the first available of the $VISUAL or $EDITOR variables.
• Alt-v Same as Alt-e.
• Home or Ctrl-A moves the cursor to the beginning of the line.
• End or Ctrl-E moves to the end of line. If the cursor is already at the end of the line, and an autosuggestion is available, End or Ctrl-E accepts the autosuggestion.
• ← (or Ctrl-B) and → (or Ctrl-F) move the cursor left or right by one character. If the cursor is already at the end of the line, and an autosuggestion is available, the → key and the Ctrl-F combination accept the suggestion.
• Delete and Backspace removes one character forwards or backwards respectively.
• Ctrl-K moves contents from the cursor to the end of line to the killring.
• Alt-c capitalizes the current word.
• Alt-u makes the current word uppercase.
• Ctrl-t transposes the last two characters
• Alt-t transposes the last two words" | read -z fish_greeting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment