My dotfiles. Period.

main.bashrc 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 grepr='grep -nr . --exclude-dir=".git" -e '
  44. alias sc='se --direction=encz.cz'
  45. alias lsblk='lsblk -o +UUID,LABEL'
  46. RV_TMP="/tmp/bash-rv"
  47. mkdir -p "$RV_TMP"
  48. ### ...... ###
  49. ### OTHERS ###
  50. ### '''''' ###
  51. export FFOO_PRETTY=color
  52. export GREP_OPTIONS="--color --binary-files=without-match"
  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