Skip to content

Instantly share code, notes, and snippets.

@kiyui
Last active August 29, 2015 14:14
Show Gist options
  • Save kiyui/c2b68cb8e10a38ffccdc to your computer and use it in GitHub Desktop.
Save kiyui/c2b68cb8e10a38ffccdc to your computer and use it in GitHub Desktop.
bash.bashrc
#
# /etc/bash.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# Bash colors
txtblk='\e[0;30m' # Black - Regular
txtred='\e[0;31m' # Red
txtgrn='\e[0;32m' # Green
txtylw='\e[0;33m' # Yellow
txtblu='\e[0;34m' # Blue
txtpur='\e[0;35m' # Purple
txtcyn='\e[0;36m' # Cyan
txtwht='\e[0;37m' # White
txtrst='\e[0m' # Text Reset
PS1="\[$txtblu\]\u\[$txtred\]@\[$txtpur\]\W\[$txtcyn\] >\[$txtrst\]"
PS2='> '
PS3='> '
PS4='+ '
# Variables
export EDITOR=vim
export SUDO_EDITOR=rnano
export FILE_MANAGER=nautilus
# Aliases
alias :q=exit
alias ls='ls --color=auto'
alias l='ls --color=auto'
alias grep='grep --color=auto'
alias pip='pip2'
alias murder='killall -SIGKILL'
alias n='$FILE_MANAGER ./ &'
# Make bash better
shopt -s autocd
shopt -s dotglob
shopt -s checkwinsize
shopt -s cdspell
shopt -s dirspell
shopt -s checkjobs
# Remember the path
source /etc/profile.d/vte.sh
# Git preferences
git config --global credential.helper 'cache --timeout=3600'
source /usr/share/git/completion/git-prompt.sh
# Command not found hook
[ -r /etc/profile.d/cnf.sh ] && . /etc/profile.d/cnf.sh
# Bash completion
[ -r /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion
case ${TERM} in
xterm*|rxvt*|Eterm|aterm|kterm|gnome*)
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
;;
screen)
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033_%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment