samer@2: # ~/.bashrc: executed by bash(1) for non-login shells. samer@2: # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) samer@2: # for examples samer@2: samer@2: # If not running interactively, don't do anything samer@2: case $- in samer@2: *i*) ;; samer@2: *) return;; samer@2: esac samer@2: samer@2: # don't put duplicate lines or lines starting with space in the history. samer@2: # See bash(1) for more options samer@2: HISTCONTROL=ignoreboth samer@2: samer@2: # append to the history file, don't overwrite it samer@2: shopt -s histappend samer@2: samer@2: # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) samer@2: HISTIGNORE="?:ls:bg:fg:cd" samer@2: HISTSIZE=10000 samer@2: HISTFILESIZE=10000 samer@2: samer@2: # check the window size after each command and, if necessary, samer@2: # update the values of LINES and COLUMNS. samer@2: shopt -s checkwinsize samer@2: samer@2: # If set, the pattern "**" used in a pathname expansion context will samer@2: # match all files and zero or more directories and subdirectories. samer@2: #shopt -s globstar samer@2: samer@2: # make less more friendly for non-text input files, see lesspipe(1) samer@2: [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" samer@2: samer@2: # set variable identifying the chroot you work in (used in the prompt below) samer@2: if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then samer@2: debian_chroot=$(cat /etc/debian_chroot) samer@2: fi samer@2: samer@2: # set a fancy prompt (non-color, unless we know we "want" color) samer@2: case "$TERM" in samer@2: xterm-color) color_prompt=yes;; samer@2: esac samer@2: color_prompt=yes samer@2: samer@2: # uncomment for a colored prompt, if the terminal has the capability; turned samer@2: # off by default to not distract the user: the focus in a terminal window samer@2: # should be on the output of commands, not on the prompt samer@2: #force_color_prompt=yes samer@2: samer@2: if [ -n "$force_color_prompt" ]; then samer@2: if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then samer@2: # We have color support; assume it's compliant with Ecma-48 samer@2: # (ISO/IEC-6429). (Lack of such support is extremely rare, and such samer@2: # a case would tend to support setf rather than setaf.) samer@2: color_prompt=yes samer@2: else samer@2: color_prompt= samer@2: fi samer@2: fi samer@2: samer@2: #if [ "$color_prompt" = yes ]; then samer@2: # PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' samer@2: #else samer@2: # PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' samer@2: #fi samer@2: PS1='\[\e[1m\]\t \u@\h:\w$\[\e[0m\] ' samer@2: unset color_prompt force_color_prompt samer@2: samer@2: # If this is an xterm set the title to user@host:dir samer@2: case "$TERM" in samer@2: xterm*|rxvt*|screen) samer@2: PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" samer@2: ;; samer@2: *) samer@2: ;; samer@2: esac samer@2: samer@2: # enable color support of ls and also add handy aliases samer@2: if [ -x /usr/bin/dircolors ]; then samer@2: test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" samer@2: alias ls='ls --color=auto' samer@2: #alias dir='dir --color=auto' samer@2: #alias vdir='vdir --color=auto' samer@2: samer@2: alias grep='grep --color=auto' samer@2: alias fgrep='fgrep --color=auto' samer@2: alias egrep='egrep --color=auto' samer@2: fi samer@2: samer@2: # some more ls aliases samer@2: alias ll='ls -alF' samer@2: alias la='ls -A' samer@2: alias l='ls -CF' samer@2: samer@2: # Add an "alert" alias for long running commands. Use like so: samer@2: # sleep 10; alert samer@2: alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' samer@2: samer@2: # Alias definitions. samer@2: # You may want to put all your additions into a separate file like samer@2: # ~/.bash_aliases, instead of adding them here directly. samer@2: # See /usr/share/doc/bash-doc/examples in the bash-doc package. samer@2: samer@2: if [ -f ~/.bash_aliases ]; then samer@2: . ~/.bash_aliases samer@2: fi samer@2: samer@2: # enable programmable completion features (you don't need to enable samer@2: # this, if it's already enabled in /etc/bash.bashrc and /etc/profile samer@2: # sources /etc/bash.bashrc). samer@2: if ! shopt -oq posix; then samer@2: if [ -f /usr/share/bash-completion/bash_completion ]; then samer@2: . /usr/share/bash-completion/bash_completion samer@2: elif [ -f /etc/bash_completion ]; then samer@2: . /etc/bash_completion samer@2: fi samer@2: fi samer@2: samer@2: