My dotfiles. Period.

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