bashrc 752 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. unset HISTFILE
  2. if [[ $EUID -ne 0 ]]; then
  3. history -r ~/.bash_history
  4. else
  5. history -r ~/.bash_history.root
  6. fi
  7. export HISTCONTROL=ignoreboth:erasedups
  8. #shopt -s histappend
  9. shopt -s globstar
  10. export _Z_CMD=j
  11. . z.sh
  12. . commacd.sh
  13. alias j="_z"
  14. v(){
  15. file=
  16. if [ $1 ]; then
  17. file=${1}
  18. shift
  19. fi
  20. url="file://${PWD}/${file}"
  21. am start -a android.intent.action.VIEW -d "$url" $@
  22. }
  23. d(){
  24. word=$1
  25. dict=${2:-ahd}
  26. tdict ~/share/dict/$dict $1
  27. }
  28. z(){
  29. #usage: z word dictname percent
  30. word=$1
  31. dict=~/share/dict/$2.xz
  32. percent=''
  33. if [ "$3" ]; then
  34. percent=${3}p
  35. fi
  36. xz -cdf -- "$dict" | less -n +"${percent}/####$word"
  37. }
  38. zb(){
  39. word=$1
  40. dict=~/share/xz/$2.xz
  41. xz -cdf -- "$dict" | less -n +"/$word"
  42. }
  43. export LESS=-inR