Skip to content

Instantly share code, notes, and snippets.

@maurofaccenda
Last active March 18, 2019 12:25
Show Gist options
  • Save maurofaccenda/b9c151b5af32676de960eb3ef1c2b2af to your computer and use it in GitHub Desktop.
Save maurofaccenda/b9c151b5af32676de960eb3ef1c2b2af to your computer and use it in GitHub Desktop.
# enable colored output
alias ls='ls -G'
alias grep='grep --color'
# ask for confirmation on destructive operation
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -i'
# history management
shopt -s histappend
shopt -s cmdhist
HISTFILESIZE=1000000
HISTSIZE=1000000
HISTCONTROL=ignoreboth
HISTIGNORE='ls:bg:fg:history'
HISTTIMEFORMAT='%F %T '
PROMPT_COMMAND='history -a'
# prompt configuration
CUSTOM_PROMPT='\[\033[38;5;10m\]\u@\h\[$(tput sgr0)\] \[\033[38;5;12m\]\W \$ \[$(tput sgr0)\]'
# prepends the prompt with the poop emoji when previous command failed
PS1="\$(test \$? != 0 && echo '💩 ')$CUSTOM_PROMPT"
# fix iTerm2 title bar not being updated after disconnecting from a SSH session
PROMPT_COMMAND="echo -ne '\033]0;${USER}@$(hostname -s)\007';$PROMPT_COMMAND"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment