25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

profile 3.4 KiB

6 년 전
10 년 전
5 년 전
10 년 전
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. #!/bin/sh
  2. # profile --- 10sr profile
  3. __safe_add_path_r(){
  4. # add path to right
  5. test -d "$1" && PATH="${PATH}:$1"
  6. }
  7. __safe_add_path_l(){
  8. # add path to left
  9. test -d "$1" && PATH="$1:${PATH}"
  10. }
  11. __safe_add_path_l "$HOME/.cabal/bin"
  12. __safe_add_path_l "$HOME/.cargo/bin"
  13. __safe_add_path_l "$HOME/.local/lib/gems/bin"
  14. __safe_add_path_l "$HOME/.gem/ruby/2.1.0/bin"
  15. __safe_add_path_l "$HOME/.local/bin"
  16. __safe_add_path_r "/c/mingw/bin"
  17. __safe_add_path_r "/c/mingw/msys/1.0/bin"
  18. export GEM_HOME="$HOME/.local/lib/gems"
  19. export RUBYLIB="$RUBYLIB:$HOME/.local/lib/gems/lib"
  20. # in my environment powerdown does not work
  21. test -z "$DISPLAY" && test -z "$SSH_CONNECTION" && \
  22. type setterm >/dev/null 2>&1 && \
  23. setterm -blank 30 -powersave on # -powerdown 10
  24. ##################################
  25. # EnvVal definitions
  26. test "$TERM" = linux && export LANG=C
  27. export LC_MESSAGES=C
  28. export LC_TIME=C
  29. export TERMCAP="${TERMCAP}:vb="
  30. # export ENV=~/.shrc
  31. export PAGER="less"
  32. export LESS="-iMRX"
  33. __batcommand=$(command -v bat || command -v batcat)
  34. if test -n "$__batcommand"
  35. then
  36. export LESSOPEN="| $__batcommand --color=always %s"
  37. # export LESSOPEN="| bat --color=always --decorations=never %s"
  38. fi
  39. if false which nvim >/dev/null
  40. then
  41. _VI_ALT=nvim
  42. elif which vim >/dev/null
  43. then
  44. _VI_ALT=vim
  45. elif which vi >/dev/null
  46. then
  47. _VI_ALT=vi
  48. fi
  49. if test -n "$_VI_ALT"
  50. then
  51. export EDITOR="$_VI_ALT"
  52. export GIT_EDITOR="$EDITOR"
  53. export VISUAL="$EDITOR"
  54. fi
  55. # export CDPATH=".:~"
  56. export GIT_PAGER="less -FRX"
  57. export GIT_MERGE_AUTOEDIT=no
  58. if test -n "$TMUX" && \
  59. expr "$TERM" : screen >/dev/null && \
  60. expr "`tmux display -p '#{client_termname}'`" : '.*-256color$' >/dev/null
  61. then
  62. TERM=screen-256color
  63. fi
  64. if test -z "$USER" -a -n "$USERNAME"
  65. then
  66. export USER=$USERNAME
  67. fi
  68. # set TMP, TEMP, TMPDIR
  69. if test -z "$TMP"
  70. then
  71. if test -n "$TMPDIR"
  72. then
  73. export TMP=$TMPDIR
  74. elif test -n "$TEMP"
  75. then
  76. export TMP="$TEMP"
  77. else
  78. export TMP=/tmp
  79. fi
  80. fi
  81. __user_md5=$(perl -e "use Digest::MD5 qw(md5_hex); print md5_hex('$USER$HOSTNAME')")
  82. expr "$TMP" : ".*${__user_md5}.*" >/dev/null || export TMP="${TMP}/${__user_md5}-tmp"
  83. test -d "$TMP" || mkdir -p "$TMP"
  84. TMP="$(cd "$TMP" && pwd)"/
  85. export TEMP=$TMP
  86. export TMPDIR=$TMP
  87. if test -d ~/dbx
  88. then
  89. export CHIT_PATH="$HOME/dbx/.chit"
  90. fi
  91. export JAVA_OPTS="$JAVA_OPTS -Duser.language=en"
  92. export GOPATH="$HOME/.golang"
  93. export PATH="$GOPATH/bin:$PATH"
  94. export PYTHONUSERBASE=$HOME/.pip
  95. export PATH="$PYTHONUSERBASE/bin:$PATH"
  96. # Enable --user by default when running pip install
  97. export PIP_USER=1
  98. export PIPENV_VENV_IN_PROJECT=1
  99. export PIPENV_MAX_DEPTH=10 # Defaults to 3
  100. export STARDICT_DATA_DIR=$HOME/.brew/share/sdcv-dict-oxford
  101. export HOMEBREW_NO_AUTO_UPDATE=1
  102. ###########################################
  103. # Host colors
  104. export _HOSTCOLOR_1=
  105. export _HOSTCOLOR_2=
  106. # black red green yellow blue magenta cyan white
  107. # Yellow is hard to read strings...
  108. case "`hostname`" in
  109. arch-vb-win8-vaio11)
  110. _HOSTCOLOR_1=magenta
  111. _HOSTCOLOR_2=white
  112. ;;
  113. darwin-mba.local)
  114. _HOSTCOLOR_1=cyan
  115. _HOSTCOLOR_2=black
  116. ;;
  117. # newkiwi)
  118. # _HOSTCOLOR_1=magenta
  119. # _HOSTCOLOR_2=white
  120. # ;;
  121. debian-vb-win7-opti)
  122. _HOSTCOLOR_1=red
  123. _HOSTCOLOR_2=white
  124. ;;
  125. *)
  126. _HOSTCOLOR_1=green
  127. _HOSTCOLOR_2=black
  128. ;;
  129. esac