My dotfiles. Period.

main.bashrc 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #!/bin/bash
  2. ## hack to workaround Fedora/Red Hat bug 878428
  3. test -f /usr/share/git-core/contrib/completion/git-prompt.sh \
  4. && . /usr/share/git-core/contrib/completion/git-prompt.sh
  5. #######################################################
  6. ### things to do BEFORE host/user-specific settings ###
  7. #######################################################
  8. ### .... ###
  9. ### SUBZ ###
  10. ### '''' ###
  11. git() {
  12. if grep -Fwqse "$1" "$GIT_DISABLED_COMMANDS"; then
  13. echo "You don't want this." >&2
  14. return 1
  15. else
  16. command git "$@"
  17. fi
  18. }
  19. grepr() {
  20. local p=$1; shift
  21. grep --color -n --exclude-dir=".git" -e "$p" -r "$@"
  22. }
  23. gitcd() {
  24. cd "$(git rev-parse --show-toplevel)"
  25. }
  26. clsz() {
  27. tput clear; tput cup $(tput lines) 0
  28. }
  29. bcdiff() {
  30. test $# -eq 2 && diff "$@" >/dev/null && return
  31. bcompare "$@" &
  32. }
  33. ### .... ###
  34. ### BASH ###
  35. ### '''' ###
  36. export HISTCONTROL=erasedups
  37. export HISTIGNORE="$HISTIGNORE:ls:ll:la:cd"
  38. export HISTIGNORE="$HISTIGNORE:git dc:git st"
  39. #export HISTIGNORE="$HISTIGNORE:se *:sc *"
  40. export HISTSIZE=-1
  41. export HISTFILESIZE=100000
  42. export GLOBIGNORE=.:..
  43. # some more aliases
  44. alias cal='cal -m'
  45. alias cls='clear'
  46. alias ll='ls -lh'
  47. alias lla='ls -lha'
  48. alias open='gnome-open'
  49. alias diff='diff -u'
  50. alias dmesg='dmesg --time-format iso'
  51. alias pad4='sed -e "s/^/ /"'
  52. alias grep='grep --color --binary-files=without-match'
  53. alias sc='se --direction=encz.cz'
  54. alias lsblk='lsblk -o +UUID,LABEL'
  55. alias xaa='xclip -o | audit2allow'
  56. alias xi='xclip -i'
  57. alias xo='xclip -o'
  58. RV_TMP="/tmp/bash-rv"
  59. mkdir -p "$RV_TMP"
  60. ### ...... ###
  61. ### OTHERS ###
  62. ### '''''' ###
  63. export LC_COLLATE=C # make sort upper first
  64. export FFOO_PRETTY=color
  65. # make green git bash trinket even cooler
  66. export GIT_PS1_SHOWDIRTYSTATE=true
  67. export GIT_PS1_SHOWUNTRACKEDFILES=true
  68. export GIT_DISABLED_COMMANDS="$HOME/.gittum/disabled-commands"
  69. # disable mounting things like SFTP to ~/.gvfs when accessed
  70. # via GIO (used by nautilus etc.)
  71. export GVFS_DISABLE_FUSE=1
  72. # disable the terrible beep sound (only for X; for tty?, blacklist pcspkr)
  73. [[ ${!DISPLAY[@]} ]] && xset b off
  74. # get rid of those .pyc files once and for all
  75. export PYTHONDONTWRITEBYTECODE=1
  76. ssh-add -l >& /dev/null || ssh-add