My dotfiles. Period.

main.bashrc 2.1KB

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