Advertisement
Guest User

Untitled

a guest
Jan 26th, 2015
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 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. GIT_PS1_SHOWDIRTYSTATE=true
  6. GIT_PS1_SHOWSTASHSTATE=true
  7. GIT_PS1_SHOWUNTRACKEDFILES=true
  8. GIT_PS1_SHOWUPSTREAM=auto
  9.  
  10. function __my_git_ps1 {
  11. log=$(git log --format=format:"%H" 1b99de3a0f49b54433165648ddf30e61e29f40ff 2> /dev/null);
  12.  
  13. if [ "$log" == "1b99de3a0f49b54433165648ddf30e61e29f40ff" ]; then
  14. return
  15. fi
  16.  
  17. __git_ps1
  18. }
  19.  
  20. # If not running interactively, don't do anything
  21. [ -z "$PS1" ] && return
  22.  
  23. if [ -n "$VNCDESKTOP" ]; then
  24. export EDITOR=emacs
  25. elif [ -z "$(pidof /usr/bin/X)" ]; then
  26. export EDITOR=emacs
  27. else
  28. export EDITOR=emacsclient
  29. fi
  30.  
  31. # don't put duplicate lines in the history. See bash(1) for more options
  32. export HISTCONTROL=ignoredups
  33. # ... and ignore same sucessive entries.
  34. export HISTCONTROL=ignoreboth
  35.  
  36. # check the window size after each command and, if necessary,
  37. # update the values of LINES and COLUMNS.
  38. shopt -s checkwinsize
  39.  
  40. # make less more friendly for non-text input files, see lesspipe(1)
  41. [ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
  42.  
  43. # set variable identifying the chroot you work in (used in the prompt below)
  44. if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
  45. debian_chroot=$(cat /etc/debian_chroot)
  46. fi
  47.  
  48. PS1="\[\033[G\]\${debian_chroot:+($debian_chroot)}\u@\h:\w\$(__my_git_ps1)\$ "
  49.  
  50. # If this is an xterm set the title to user@host:dir
  51. case "$TERM" in
  52. xterm*|rxvt*)
  53. PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}$(__my_git_ps1)\007"'
  54. ;;
  55. *)
  56. ;;
  57. esac
  58.  
  59. if [ -f ~/.bash_aliases ]; then
  60. . ~/.bash_aliases
  61. fi
  62.  
  63. # enable color support of ls and also add handy aliases
  64. if [ "$TERM" != "dumb" ]; then
  65. eval "`dircolors -b`"
  66. alias ls='ls --color=auto'
  67. fi
  68.  
  69. # enable programmable completion features (you don't need to enable
  70. # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
  71. # sources /etc/bash.bashrc).
  72. if [ -f /etc/bash_completion ]; then
  73. . /etc/bash_completion
  74. fi
  75.  
  76. if [ -f ~/perl5/perlbrew/etc/bashrc ]; then
  77. . ~/perl5/perlbrew/etc/bashrc
  78. fi
  79.  
  80. if [ -f ~/.rvm/scripts/rvm ]; then
  81. . ~/.rvm/scripts/rvm
  82. fi
  83.  
  84. function my_cd() {
  85. set +e
  86. set +x
  87. if [ -z "$1" ]; then
  88. target=~
  89. else
  90. target=$1
  91. fi
  92. cd $target
  93.  
  94. is_at_work=$(perlbrew info|grep 'perl-5\.16\.3@work')
  95. case `pwd`/ in
  96. /home/autarch/work/*)
  97. if [[ "$is_at_work" == "" ]]; then
  98. perlbrew use perl-5.16.3@work
  99. fi
  100. ;;
  101. *)
  102. if [[ "$is_at_work" != "" ]]; then
  103. perlbrew use perl-5.20.1
  104. fi
  105. ;;
  106. esac
  107. }
  108.  
  109. alias cd='my_cd'
  110.  
  111. shopt -s no_empty_cmd_completion
  112.  
  113. export DEBEMAIL="autarch@urth.org"
  114. export DEBFULLNAME="Dave Rolsky"
  115.  
  116. export GOPATH=~/go
  117.  
  118. export PATH=~/bin:$PATH:$GOPATH/bin
  119.  
  120. cd .
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement