bashrc 3.7 KB

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