Advertisement
Guest User

~/.bashrc

a guest
May 21st, 2012
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 5.41 KB | None | 0 0
  1. # ~/.bashrc: executed by bash(1) for non-login shells.
  2. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
  3. # for examples
  4.  
  5. # If not running interactively, don't do anything
  6. [ -z "$PS1" ] && return
  7.  
  8. # don't put duplicate lines in the history. See bash(1) for more options
  9. # don't overwrite GNU Midnight Commander's setting of `ignorespace'.
  10. HISTCONTROL=$HISTCONTROL${HISTCONTROL+:}ignoredups
  11. # ... or force ignoredups and ignorespace
  12. HISTCONTROL=ignoreboth
  13.  
  14. # append to the history file, don't overwrite it
  15. shopt -s histappend
  16.  
  17. # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
  18.  
  19. # check the window size after each command and, if necessary,
  20. # update the values of LINES and COLUMNS.
  21. shopt -s checkwinsize
  22.  
  23. # make less more friendly for non-text input files, see lesspipe(1)
  24. #[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
  25.  
  26. # set variable identifying the chroot you work in (used in the prompt below)
  27. if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
  28.     debian_chroot=$(cat /etc/debian_chroot)
  29. fi
  30.  
  31. # set a fancy prompt (non-color, unless we know we "want" color)
  32. case "$TERM" in
  33.     xterm-color) color_prompt=yes;;
  34. esac
  35.  
  36. # uncomment for a colored prompt, if the terminal has the capability; turned
  37. # off by default to not distract the user: the focus in a terminal window
  38. # should be on the output of commands, not on the prompt
  39. force_color_prompt=yes
  40.  
  41. if [ -n "$force_color_prompt" ]; then
  42.     if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
  43.     # We have color support; assume it's compliant with Ecma-48
  44.     # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
  45.     # a case would tend to support setf rather than setaf.)
  46.     color_prompt=yes
  47.     else
  48.     color_prompt=
  49.     fi
  50. fi
  51.  
  52. if [ "$color_prompt" = yes ]; then
  53.  
  54.     PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
  55.    
  56. else
  57.     PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
  58. fi
  59.  
  60.  
  61. bash_prompt() {
  62.     local NONE="\[\033[0m\]"    # unsets color to term's fg color
  63.  
  64.     # regular colors
  65.     local K="\[\033[0;30m\]"    # black
  66.     local R="\[\033[0;31m\]"    # red
  67.     local G="\[\033[0;32m\]"    # green
  68.     local Y="\[\033[0;33m\]"    # yellow
  69.     local B="\[\033[0;34m\]"    # blue
  70.     local M="\[\033[0;35m\]"    # magenta
  71.     local C="\[\033[0;36m\]"    # cyan
  72.     local W="\[\033[0;37m\]"    # white
  73.  
  74.     # emphasized (bolded) colors
  75.     local EMK="\[\033[1;30m\]"
  76.     local EMR="\[\033[1;31m\]"
  77.     local EMG="\[\033[1;32m\]"
  78.     local EMY="\[\033[1;33m\]"
  79.     local EMB="\[\033[1;34m\]"
  80.     local EMM="\[\033[1;35m\]"
  81.     local EMC="\[\033[1;36m\]"
  82.     local EMW="\[\033[1;37m\]"
  83.  
  84.     # background colors
  85.     local BGK="\[\033[40m\]"
  86.     local BGR="\[\033[41m\]"
  87.     local BGG="\[\033[42m\]"
  88.     local BGY="\[\033[43m\]"
  89.     local BGB="\[\033[44m\]"
  90.     local BGM="\[\033[45m\]"
  91.     local BGC="\[\033[46m\]"
  92.     local BGW="\[\033[47m\]"
  93.  
  94.     # If this is an xterm set the title to user@host:dir
  95.     case "$TERM" in
  96.     xterm*|rxvt*)
  97.         PS1="\n$EMC╔╡$EMB♥ρεαςε, ΔυΔε!♥$EMC╞═╡$EMG\u$EMC╞═╡$EMM\h$EMC╞═╡$EMY\t$EMC╞═╡$EMW\w$EMC│\[\033[s\]\[\033[0;\$((0))f\]$R░░░$EMR░░$EMY░░$EMG░░$EMC░░$B░░$M░░$R▒▒$EMR▒▒$EMY▒▒$EMG▒▒$EMC▒▒$B▒▒$M▒▒$R▓▓$EMR▓▓$EMY▓▓$EMG▓▓$EMC▓▓$B▓▓$M▓▓$R██$EMR██$EMY██$EMG██$EMC██$B██$M██$EMY $(date +%c) $M██$B██$EMC██$EMG██$EMY██$EMR██$R██$M▓▓$B▓▓$EMC▓▓$EMG▓▓$EMY▓▓$EMR▓▓$R▓▓$M▒▒$B▒▒$EMC▒▒$EMG▒▒$EMY▒▒$EMR▒▒$R▒▒$M░░$B░░$EMC░░$EMG░░$EMY░░$EMR░░$R░░░\[\033[u\]
  98. $EMC╚⋗ $EMG\$$NONE "
  99.         ;;
  100.     *)
  101.         PS1="\n$EMC╔╡$EMG\u$EMC╞═╡$EMM\h$EMC╞═╡$EMY\t$EMC╞═╡$EMW\w$EMC│\[\033[s\]\[\033[;\$((0))f\]$R$EMR░░$EMY░░$EMG░░$EMC░░$B░░$M░░$R▒▒$EMR▒▒$EMY▒▒$EMG▒▒$EMC▒▒$B▒▒$M▒▒$R▓▓$EMR▓▓$EMY▓▓$EMG▓▓$EMC▓▓$B▓▓$M▓▓$R██$EMR██$EMY$EMG$EMC$B$M$EMY $(date +%c) $M$B$EMC$EMG$EMY$EMR██$R██$M▓▓$B▓▓$EMC▓▓$EMG▓▓$EMY▓▓$EMR▓▓$R▓▓$M▒▒$B▒▒$EMC▒▒$EMG▒▒$EMY▒▒$EMR▒▒$R▒▒$M░░$B░░$EMC░░$EMG░░$EMY░░$EMR░░$R░░\[\033[u\]
  102. $EMC╚>$EMG\$$NONE "
  103.         ;;
  104.     esac
  105. }
  106.  
  107. #bash_prompt
  108. bash_prompt unset color_prompt force_color_prompt
  109.  
  110. # enable color support of ls and also add handy aliases
  111. if [ -x /usr/bin/dircolors ]; then
  112.     test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
  113.     alias ls='ls --color=auto'
  114.     #alias dir='dir --color=auto'
  115.     #alias vdir='vdir --color=auto'
  116.  
  117.     #alias grep='grep --color=auto'
  118.     #alias fgrep='fgrep --color=auto'
  119.     #alias egrep='egrep --color=auto'
  120. fi
  121.  
  122. # some more ls aliases
  123.  
  124. # Alias definitions.
  125. # You may want to put all your additions into a separate file like
  126. # ~/.bash_aliases, instead of adding them here directly.
  127. # See /usr/share/doc/bash-doc/examples in the bash-doc package.
  128.  
  129. if [ -f ~/.bash_aliases ]; then
  130.     . ~/.bash_aliases
  131. fi
  132.  
  133. # enable programmable completion features (you don't need to enable
  134. # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
  135. # sources /etc/bash.bashrc).
  136. if [ -f /etc/bash_completion ]; then
  137.     . /etc/bash_completion
  138. fi
  139.  
  140. export EDITOR="nano"
  141. unset INPUTRC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement