.bashrc 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # .bashrc
  2. # User specific aliases and functions
  3. # Source global definitions
  4. if [ -f /etc/bashrc ]; then
  5. . /etc/bashrc
  6. fi
  7. set -o vi
  8. # Git autocomplete
  9. source ~/git-completion.bash
  10. # Override existing commands
  11. alias ls='ls -alhG'
  12. alias ..='cd ..'
  13. # Misc.
  14. alias x='exit'
  15. # CVS
  16. # alias crm='cvs rm -f $1'
  17. # alias ccm='cvs commit -m "$1"'
  18. # Screen aliases
  19. # alias sl='screen -ls'
  20. # alias sx='screen -x $1'
  21. # alias sr='screen -Rd $1'
  22. # alias ss='screen -S $1'
  23. # alias sc='clear; screen'
  24. # alias sn='clear; screen'
  25. # Utilities
  26. # export CVSROOT=/cvsroot
  27. export GREP_COLOR='1;35'
  28. alias grep='grep --color=auto'
  29. function set_prompt {
  30. local blue="\[\033[1;34m\]"
  31. local gray="\[\033[0;37m\]"
  32. local green="\[\033[1;32m\]"
  33. export PS1="[$blue\d @ \@$gray]\n$gray[\[email protected]\h$green:\w$gray"'$(__git_ps1 "][%s")'"] "
  34. }
  35. set_prompt
  36. bind TAB:menu-complete
  37. # function cvsradd {
  38. # find * -name CVS -prune -o -type f -print | xargs cvs add
  39. # find * -type d -print | xargs cvs add
  40. # }
  41. function gtar {
  42. if [ $# != 0 ]
  43. then
  44. if [ $1 = "-nodate" ]
  45. then
  46. shift
  47. FILE=$1
  48. else
  49. DATE=$(date "+%Y%m%d")
  50. FILE=$1_${DATE}
  51. fi
  52. shift
  53. tar -cvf ${FILE}.tar $*
  54. gzip ${FILE}.tar
  55. else
  56. echo "Usage: gtar [-nodate] filename file1 [file2 file3 ...]"
  57. echo ""
  58. echo "Creates a gzip'd tarball called filename[_DATE].tar.gz containing"
  59. echo "file1..fileN. The -nodate switch will remove the _DATE from the"
  60. echo "filename if specified."
  61. fi
  62. }
  63. export PATH=$PATH:/usr/local/bin/:/usr/local/arm-elf/bin
  64. export TERM=xterm-256color