bashrc 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. # If not running interactively, don't do anything
  2. [ -z "$PS1" ] && return
  3. # ignoredups and ignorespace
  4. export HISTCONTROL=ignoreboth
  5. # append to the history file, don't overwrite it
  6. shopt -s histappend
  7. # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
  8. # check the window size after each command and, if necessary,
  9. # update the values of LINES and COLUMNS.
  10. shopt -s checkwinsize
  11. # make less more friendly for non-text input files, see lesspipe(1)
  12. #[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
  13. # set variable identifying the chroot you work in (used in the prompt below)
  14. if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
  15. debian_chroot=$(cat /etc/debian_chroot)
  16. fi
  17. # set a fancy prompt (non-color, unless we know we "want" color)
  18. case "$TERM" in
  19. xterm-color) color_prompt=yes;;
  20. esac
  21. # uncomment for a colored prompt, if the terminal has the capability; turned
  22. # off by default to not distract the user: the focus in a terminal window
  23. # should be on the output of commands, not on the prompt
  24. #force_color_prompt=yes
  25. #if [ -n "$force_color_prompt" ]; then
  26. # if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
  27. # We have color support; assume it's compliant with Ecma-48
  28. # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
  29. # a case would tend to support setf rather than setaf.)
  30. # color_prompt=yes
  31. # else
  32. # color_prompt=
  33. # fi
  34. #fi
  35. #if [ "$color_prompt" = yes ]; then
  36. # PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
  37. #else
  38. # PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
  39. #fi
  40. #unset color_prompt force_color_prompt
  41. # If this is an xterm set the title to user@host:dir
  42. #case "$TERM" in
  43. #xterm*|rxvt*)
  44. # PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
  45. # ;;
  46. #*)
  47. # ;;
  48. #esac
  49. COLOR_RED="\[\e[0;31m\]"
  50. COLOR_GREEN="\[\e[0;32m\]"
  51. COLOR_YELLOW="\[\e[0;33m\]"
  52. COLOR_BLUE="\[\e[0;34m\]"
  53. COLOR_MAGENTA="\[\e[0;35m\]"
  54. COLOR_CYAN="\[\e[0;36m\]"
  55. COLOR_RED_BOLD="\[\e[31;1m\]"
  56. COLOR_GREEN_BOLD="\[\e[32;1m\]"
  57. COLOR_YELLOW_BOLD="\[\e[33;1m\]"
  58. COLOR_BLUE_BOLD="\[\e[34;1m\]"
  59. COLOR_MAGENTA_BOLD="\[\e[35;1m\]"
  60. COLOR_CYAN_BOLD="\[\e[36;1m\]"
  61. COLOR_NONE="\[\e[0m\]"
  62. export PS1="${COLOR_GREEN_BOLD}\h${COLOR_NONE}:${COLOR_BLUE_BOLD}\w${COLOR_NONE}\$ "
  63. # Alias definitions.
  64. # You may want to put all your additions into a separate file like
  65. # ~/.bash_aliases, instead of adding them here directly.
  66. # See /usr/share/doc/bash-doc/examples in the bash-doc package.
  67. #if [ -f ~/.bash_aliases ]; then
  68. # . ~/.bash_aliases
  69. #fi
  70. # enable color support of ls and also add handy aliases
  71. if [ -x /usr/bin/dircolors ]; then
  72. eval "`dircolors -b`"
  73. fi
  74. alias ls='ls --color=auto -hv'
  75. alias ll='ls -l'
  76. alias la='ls -A'
  77. alias l.='ls -d .*'
  78. alias df='df -hx tmpfs'
  79. alias du='du -h --max-depth=1'
  80. function cl () {
  81. if [ $# = 0 ]; then
  82. cd && ls
  83. else
  84. cd "$*" && ls
  85. fi
  86. }
  87. alias sr='screen -r'
  88. alias grep='grep --color=auto'
  89. alias fgrep='fgrep --color=auto'
  90. alias egrep='egrep --color=auto'
  91. # enable programmable completion features (you don't need to enable
  92. # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
  93. # sources /etc/bash.bashrc).
  94. if [ -f /etc/bash_completion ]; then
  95. . /etc/bash_completion
  96. fi
  97. export LESS_TERMCAP_mb=$'\E[01;31m'
  98. export LESS_TERMCAP_md=$'\E[01;31m'
  99. export LESS_TERMCAP_me=$'\E[0m'
  100. export LESS_TERMCAP_se=$'\E[0m'
  101. export LESS_TERMCAP_so=$'\E[01;44;33m'
  102. export LESS_TERMCAP_ue=$'\E[0m'
  103. export LESS_TERMCAP_us=$'\E[01;32m'
  104. export EDITOR=vim