RUNME 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #!/bin/sh
  2. # This script pulls extra software and creates appropriate symlinks in the home
  3. # directory
  4. # Run from where it's located (within dotfiles directory)
  5. # A lot of this extra knowledge courtesy of vimcasts.org!
  6. # Make a known_hosts file if none, otherwise zsh throws an error for our .zshrc
  7. if test -f ~/.ssh/known_hosts; then
  8. echo "known_hosts found..."
  9. else
  10. mkdir -p ~/.ssh
  11. touch ~/.ssh/known_hosts
  12. echo "known_hosts created (blank)..."
  13. fi
  14. # Ack for this user (perl 5.8.8 or higher on system)
  15. # Curl may need to have proxy settings
  16. if test -f ~/bin/ack; then
  17. echo "ack found..."
  18. else
  19. mkdir -p ~/bin
  20. curl http://betterthangrep.com/ack-standalone > ~/bin/ack
  21. chmod 0755 ~/bin/ack
  22. echo "ack installed from betterthangrep.com..."
  23. fi
  24. # color for git! Some machines don't have it.
  25. git config --global color.ui true
  26. git config --global core.editor "vim"
  27. echo "git colour and editor setup..."
  28. # This repository has vim plugins as submodules, so initialise and clone them
  29. git submodule init
  30. git submodule update
  31. echo "dotfiles submodules done..."
  32. # Add more vim plugins from this dotfiles directory, like so:
  33. # git submodule add git://github.com/tpope/module.git vim/bundle/module
  34. #
  35. # Apart from updating plugins individually, you can update all submodules
  36. # git submodule foreach git pull origin master
  37. #
  38. # Thanks to: https://github.com/dangerous/dotfiles
  39. # for cleaner way of handling symlinking
  40. #
  41. BACKUP_DIR="/tmp/$(date)"
  42. mkdir "$BACKUP_DIR"
  43. # Zsh
  44. mv ~/.zshrc "$BACKUP_DIR"
  45. ln -s dotfiles/zsh/zshrc ~/.zshrc
  46. mv ~/.zshenv "$BACKUP_DIR"
  47. ln -s dotfiles/zsh/zshenv ~/.zshenv
  48. # Vim
  49. mv ~/.vim "$BACKUP_DIR"
  50. ln -s dotfiles/vim ~/.vim
  51. mv ~/.vimrc "$BACKUP_DIR"
  52. ln -s dotfiles/vim/vimrc ~/.vimrc
  53. mkdir -p ~/.vimundo # persistent undo directory
  54. # SSH Config
  55. mv ~/.ssh/config "$BACKUP_DIR"
  56. ln -s ../dotfiles/ssh/config ~/.ssh/config
  57. # Pentadactyl
  58. mv ~/.pentadactylrc "$BACKUP_DIR"
  59. ln -s dotfiles/pentadactyl/pentadactylrc ~/.pentadactylrc
  60. # Screen
  61. mv ~/.screenrc "$BACKUP_DIR"
  62. ln -s dotfiles/screen/screenrc ~/.screenrc
  63. # Nethack
  64. mv ~/.nethackrc "$BACKUP_DIR"
  65. ln -s dotfiles/nethack/nethackrc ~/.nethackrc
  66. # Irssi
  67. mv ~/.irssi "$BACKUP_DIR"
  68. ln -s dotfiles/irssi ~/.irssi
  69. # Mongo
  70. mv ~/.mongorc.js "$BACKUP_DIR"
  71. ln -s dotfiles/mongo/mongorc.js ~/.mongorc.js
  72. echo "Setup complete!"