Show git branch

# Show git branch on the left (recommend)
PS1='$(__git_ps1)'$PS1
# Show git branch on the right (sometimes buggy when command is long)
rightprompt()
{
    printf "%*s" $COLUMNS "$(__git_ps1)"
}
PS1='\[$(tput sc; rightprompt; tput rc)\]'$PS1

Save history immediate

https://askubuntu.com/questions/67283/is-it-possible-to-make-writing-to-bash-history-immediate

shopt -s histappend
PROMPT_COMMAND="history -a;$PROMPT_COMMAND"

Increase history

export HISTFILESIZE=10000
export HISTSIZE=10000

Auto go to directory without cd

Type .. instead of cd ..

Add this to end of ~/.bashrc or ~/.zshrc

shopt -s autocd
# Enable C-s
stty -ixon