My dotfiles. Period.

main.bashrc 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. clsz() {
  17. tput clear; tput cup $(tput lines) 0
  18. }
  19. bcdiff() {
  20. test $# -eq 2 && diff "$@" >/dev/null && return
  21. bcompare "$@" &
  22. }
  23. ### .... ###
  24. ### BASH ###
  25. ### '''' ###
  26. export HISTCONTROL=$HISTCONTROL${HISTCONTROL:+:}ignoredups
  27. export HISTIGNORE=$HISTIGNORE:ls:ll:la:cd
  28. export HISTIGNORE="$HISTIGNORE:git ap:git cm:git cma:git dc:git st"
  29. export HISTIGNORE="$HISTIGNORE:se *:sc *"
  30. export HISTFILESIZE=10000
  31. export GLOBIGNORE=.:..
  32. # some more aliases
  33. alias cal='cal -m'
  34. alias cls='clear'
  35. alias ll='ls -lh'
  36. alias lla='ls -lha'
  37. alias open='gnome-open'
  38. alias diff='diff -u'
  39. alias pad4='sed -e "s/^/ /"'
  40. alias grepr='grep -nr . --exclude-dir=".git" -e '
  41. alias sc='se --direction=encz.cz'
  42. alias lsblk='lsblk -o +UUID,LABEL'
  43. ### ...... ###
  44. ### OTHERS ###
  45. ### '''''' ###
  46. export FFOO_PRETTY=color
  47. export GREP_OPTIONS="--color --binary-files=without-match"
  48. # make green git bash trinket even cooler
  49. export GIT_PS1_SHOWDIRTYSTATE=true
  50. export GIT_PS1_SHOWUNTRACKEDFILES=true
  51. export GIT_DISABLED_COMMANDS="$HOME/.gittum/disabled-commands"
  52. # disable mounting things like SFTP to ~/.gvfs when accessed
  53. # via GIO (used by nautilus etc.)
  54. export GVFS_DISABLE_FUSE=1
  55. # disable the terrible beep sound (only for X; for tty?, blacklist pcspkr)
  56. [[ ${!DISPLAY[@]} ]] && xset b off
  57. # get rid of those .pyc files once and for all
  58. export PYTHONDONTWRITEBYTECODE=1
  59. ssh-add -l >& /dev/null || ssh-add