.bashrc 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # ~/.bashrc
  2. # If not running interactively, don't do anything
  3. [[ $- != *i* ]] && return
  4. # Don't put duplicate lines in the history
  5. # Don't save commands which start with a space
  6. HISTCONTROL=ignoredups:erasedups:ignorespace
  7. HISTTIMEFORMAT="%Y/%m/%d %R "
  8. HISTSIZE=10000
  9. HISTFILESIZE=10000
  10. shopt -s histappend # Append to the history file, don't overwrite it
  11. shopt -s histreedit # Re-edit a failed history substitution
  12. shopt -s histverify # Verify an history substitution before executing
  13. BOLD="$(tput bold)"
  14. RESET="$(tput sgr0)"
  15. RED="$(tput setaf 1)"
  16. GREEN="$(tput setaf 2)"
  17. YELLOW="$(tput setaf 3)"
  18. BLUE="$(tput setaf 4)"
  19. MAGENTA="$(tput setaf 5)"
  20. CYAN="$(tput setaf 6)"
  21. WHITE="$(tput setaf 7)"
  22. PS1='\[$BOLD\]\[$BLUE\]\u\[$RED\]@\[$GREEN\]\h:\[$MAGENTA\]\w'
  23. if [[ -n "${SSH_CONNECTION:-}" ]]
  24. then
  25. PS1="$PS1"'\[$RESET\]\[$CYAN\] [ssh]'
  26. fi
  27. if ! type -t __git_ps1 &>/dev/null && [ -e /usr/share/git-core/contrib/completion/git-prompt.sh ]
  28. then
  29. source /usr/share/git-core/contrib/completion/git-prompt.sh
  30. fi
  31. if type -t __git_ps1 &>/dev/null
  32. then
  33. PS1="$PS1"'\[$RESET\]\[$CYAN\]$(__git_ps1 " [%s]")'
  34. export GIT_PS1_SHOWDIRTYSTATE=1
  35. export GIT_PS1_SHOWUNTRACKEDFILES=1
  36. fi
  37. # End prompt
  38. PS1="$PS1"' \[$RESET\]$ '
  39. if [[ -f /etc/bash_completion ]]
  40. then
  41. source /etc/bash_completion
  42. fi
  43. if [[ -r "$HOME/.bash_aliases" ]]
  44. then
  45. source "$HOME/.bash_aliases"
  46. fi
  47. if [[ -r "$HOME/.bash_functions" ]]
  48. then
  49. source "$HOME/.bash_functions"
  50. PROMPT_COMMAND=_bash_history_sync
  51. fi
  52. if [[ -x /usr/bin/dircolors ]]
  53. then
  54. if [[ -r "$HOME/.colors" ]]
  55. then
  56. eval "$(dircolors "$HOME/.colors")"
  57. else
  58. eval "$(dircolors -b)"
  59. fi
  60. fi
  61. export EDITOR="/usr/bin/vim"
  62. export PYTHONSTARTUP="$HOME/.pythonrc"