My dotfiles. Period.

main.bashrc 2.0KB

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