My dotfiles. Period.

main.bashrc 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. alias xi='xclip -i'
  52. alias xo='xclip -o'
  53. RV_TMP="/tmp/bash-rv"
  54. mkdir -p "$RV_TMP"
  55. ### ...... ###
  56. ### OTHERS ###
  57. ### '''''' ###
  58. export FFOO_PRETTY=color
  59. # make green git bash trinket even cooler
  60. export GIT_PS1_SHOWDIRTYSTATE=true
  61. export GIT_PS1_SHOWUNTRACKEDFILES=true
  62. export GIT_DISABLED_COMMANDS="$HOME/.gittum/disabled-commands"
  63. # disable mounting things like SFTP to ~/.gvfs when accessed
  64. # via GIO (used by nautilus etc.)
  65. export GVFS_DISABLE_FUSE=1
  66. # disable the terrible beep sound (only for X; for tty?, blacklist pcspkr)
  67. [[ ${!DISPLAY[@]} ]] && xset b off
  68. # get rid of those .pyc files once and for all
  69. export PYTHONDONTWRITEBYTECODE=1
  70. ssh-add -l >& /dev/null || ssh-add