Source

dotfiles / bashrc

# Check for an interactive session
[ -z "$PS1" ] && return

source "${HOME}/.shellrc"

#### Setup prompt ###################################################
color() {
  case $1 in
    white   ) echo 30; return ;;
    red     ) echo 31; return ;;
    green   ) echo 32; return ;;
    yellow  ) echo 33; return ;;
    blue    ) echo 34; return ;;
    magenta ) echo 35; return ;;
    cyan    ) echo 36; return ;;
    *       ) echo  1; return ;; # bold → "something's wrong"
  esac
}

prompt_format="\e[`color $prompt_color`m"

PS1="\[$prompt_format\]\u@\h\[\e[m\] \w\n\$ "

#### Setup autocompletion ###########################################
man() {
  env \
    LESS_TERMCAP_mb=$(printf "\e[1;37m") \
    LESS_TERMCAP_md=$(printf "\e[1;37m") \
    LESS_TERMCAP_me=$(printf "\e[0m") \
    LESS_TERMCAP_se=$(printf "\e[0m") \
    LESS_TERMCAP_so=$(printf "\e[1;47;30m") \
    LESS_TERMCAP_ue=$(printf "\e[0m") \
    LESS_TERMCAP_us=$(printf "\e[0;36m") \
      man "$@"
}

complete -cf man
complete -cf sudo
#source /usr/lib/node_modules/npm/lib/utils/completion.sh

#export GTK_IM_MODULE=ibus
#export XMODIFIERS=@im=ibus
#export QT_IM_MODULE=ibus