Last Updated: February 25, 2016
·
571
· icholy

zsh hints

I was trying to find an easier way to remember zsh's keybinings so I added the following to my .zshrc to show me hints on startup

 # show welcome message
ZSH_HINTS=()
ZSH_HINTS+=("CTRL + A Move to the beginning of the line")
ZSH_HINTS+=("CTRL + E Move to the end of the line")
ZSH_HINTS+=("ALT + B  Move one word backward")
ZSH_HINTS+=("ALT + F Move one word forward")
ZSH_HINTS+=("CTRL + U Clear the entire line")
ZSH_HINTS+=("CTRL + K Clear the characters on the line after the current cursor position")
ZSH_HINTS+=("CTRL + W Delete a word before the cursor")
ZSH_HINTS+=("ALT + D  Delete a word after the cursor")
ZSH_HINTS+=("CTRL + R Search history")
ZSH_HINTS+=("CTRL + G Escape from search mode")
ZSH_HINTS+=("CTRL + _ Undo the last change")
ZSH_HINTS+=("CTRL + L Clear screen")
ZSH_HINTS+=("CTRL + C Terminate/kill current foreground process")
ZSH_HINTS+=("CTRL + Z Suspend/stop current foreground process")
cowsay ${ZSH_HINTS[$(($(($RANDOM % ${#ZSH_HINTS})) + 1))]}