Skip to content

Instantly share code, notes, and snippets.

@brotich
Created December 28, 2019 06:21
Show Gist options
  • Save brotich/1a94c07fd4ea95712b2153b140a2c256 to your computer and use it in GitHub Desktop.
Save brotich/1a94c07fd4ea95712b2153b140a2c256 to your computer and use it in GitHub Desktop.
Print shell commands on start up

set up

  1. add to the .zshrc or .bashrc

sample output

c-f  Move forward
c-b  Move backward
c-p  Move up
c-n  Move down
c-a  Jump to beginning of line
c-e  Jump to end of line
c-d  Delete forward
c-h  Delete backward
c-k  Delete forward to end of line
c-u  Delete entire line
# MOTD
function echo_color() {
local color="$1"
printf "${color}$2\033[0m\n"
}
echo_color "\033[0;90m" "c-f Move forward"
echo_color "\033[0;90m" "c-b Move backward"
echo_color "\033[0;90m" "c-p Move up"
echo_color "\033[0;90m" "c-n Move down"
echo_color "\033[0;90m" "c-a Jump to beginning of line"
echo_color "\033[0;90m" "c-e Jump to end of line"
echo_color "\033[0;90m" "c-d Delete forward"
echo_color "\033[0;90m" "c-h Delete backward"
echo_color "\033[0;90m" "c-k Delete forward to end of line"
echo_color "\033[0;90m" "c-u Delete entire line"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment