You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

70 lines
2.2 KiB

  1. #!/bin/sh
  2. mkdir -p ~/.my/log
  3. mkdir -p ~/.local/bin
  4. install_script(){
  5. local dir="$HOME/.local/bin"
  6. mkdir -p "$dir"
  7. for f in "$@"
  8. do
  9. bn=$(basename "$f")
  10. type $bn >/dev/null 2>&1 || {
  11. if type wget >/dev/null 2>&1
  12. then
  13. wget "$f" -P "$dir/" &&
  14. chmod u+x "${dir}/${bn}"
  15. elif type curl >/dev/null 2>&1
  16. then
  17. curl --url "$f" --output "${dir}/${bn}" &&
  18. chmod u+x "${dir}/${bn}"
  19. fi
  20. }
  21. done
  22. }
  23. install_symlink_script(){
  24. mkdir -p "$HOME/.local/bin/"
  25. for f in "$@"
  26. do
  27. ln -s "$PWD/$f" "$HOME/.local/bin/"
  28. done
  29. }
  30. git_config(){
  31. git config --global user.name '10sr'
  32. git config --global user.email '8slashes+git@gmail.com'
  33. git config --global core.autocrlf false
  34. git config --global core.excludesfile '~/.gitignore'
  35. git config --global color.ui auto
  36. git config --global status.relativePaths false
  37. git config --global status.showUntrackedFiles normal
  38. git config --global log.date iso
  39. git config --global alias.graph "log --graph --date-order -C -M --pretty=tformat:\"<%h> %ad [%an] %Cgreen%d%Creset %s\" --all --date=iso"
  40. git config --global alias.st "status -s -b"
  41. git config --global alias.b "branch"
  42. git config --global alias.ci "commit --verbose"
  43. git config --global alias.co "checkout"
  44. git config --global alias.cim "commit --verbose -m"
  45. git config --global alias.di "diff --color"
  46. git config --global alias.me "merge --no-ff --stat -v"
  47. git config --global alias.ls "ls-files -v --full-name"
  48. git config --global alias.sl "!sl"
  49. # git config --global alias.my-ls "ls-files | xargs ls"
  50. # git config --global alias.ll "!git ls-files | xargs ls -l -CFG --color=auto --time-style=long-iso"
  51. git config --global alias.addi "add -i"
  52. if false iswindows; then
  53. git config --global core.fileMode false
  54. fi
  55. }
  56. gen_source_script(){
  57. # _gen_source_script file lines
  58. test $# -eq 2 || return 1
  59. head -n $2 $1 | \grep -v '^#!' | sed -e 's/^..//g'
  60. }
  61. install_script http://www.frexx.de/xterm-256-notes/data/colortable16.sh http://www.frexx.de/xterm-256-notes/data/256colors2.pl
  62. type git >/dev/null 2>&1 && _my_git_config