Skip to content

Instantly share code, notes, and snippets.

@matthieubosquet
Created December 23, 2011 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthieubosquet/1514482 to your computer and use it in GitHub Desktop.
Save matthieubosquet/1514482 to your computer and use it in GitHub Desktop.
Custom shell for debian
# Custom Bash neig.es
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# If changed, Update $LINES and $COLUMNS after each command
shopt -s checkwinsize
# Default editor
export EDITOR=vim
# Default colors
COLOR_GRAY="[37m"
COLOR_PINK="[35m"
COLOR_GREEN="[32m"
COLOR_ORANGE="[33m"
COLOR_RED="[31m"
DEFAULT_COLOR="[00m"
if [ `id -u` == '0' ]; then
USER_COLOR=$COLOR_RED
else
USER_COLOR=$COLOR_PINK
fi
# Baseprompt
export BASEPROMPT='\n\e${USER_COLOR}\u \
\e${COLOR_GRAY}at \e${COLOR_ORANGE}\h \
\e${COLOR_GRAY}in \e${COLOR_GREEN}\w\
\e${DEFAULT_COLOR}'
export PS1="${BASEPROMPT}
$ "
# History (HISTSIZE maximum saves in 1 session)
export HISTTIMEFORMAT='%F %T '
export HISTSIZE=2000
export HISTFILESIZE=2000
# History, eternal
PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND ; }"'echo $$ $USER \
"$(history 1)" >> ~/.bash_eternal_history'
# Grep
export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32'
# Aliases, ls
alias ls='ls --color=auto'
alias la='ls -Ash'
alias ll='ls -lh'
alias lla='ls -lAsh'
# Aliases, cd
alias desk='cd ~/Desktop'
alias ..='cd ..'
# Function cd+ls
function cdl { cd $1; ls;}
# Aliases, apt
alias update='apt-get update'
alias upgrade='apt-get upgrade'
alias install='apt-get install'
# Aliases, git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment