My dotfiles. Period.

main.bashrc 2.0KB

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