Emacs config utilizing prelude as a base
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.

54 lines
1.9 KiB

  1. PRELUDE_INSTALL_DIR="$HOME/.emacs.d"
  2. PRELUDE_URL=https://github.com/bbatsov/prelude.git
  3. if [ -d $PRELUDE_INSTALL_DIR/prelude ]
  4. then
  5. printf "\e[33m You already have Prelude installed.\e[0m You'll need to remove $PRELUDE_INSTALL_DIR if you want to install Prelude again.\n"
  6. exit 1;
  7. fi
  8. printf "Checking to see if git is installed... "
  9. hash git 2>&- || { printf >&2 "\e[33mnot found. Aborting installation!\e[0m"; exit 1; }
  10. printf "\e[32mfound.\e[0m\n"
  11. printf "Checking to see if aspell is installed... "
  12. hash aspell 2>&- || { printf >&2 "\e[33mnot found. Install aspell to benefit from flyspell-mode!\e[0m"; }
  13. printf "\e[32mfound.\e[0m\n"
  14. printf "Checking to see if ack is installed... "
  15. hash ack 2>&- || { printf >&2 "\e[33mnot found. You'll need it to use ack-and-a-half!\e[0m"; }
  16. printf "\e[32mfound.\e[0m\n"
  17. printf "Looking for an existing Emacs config... "
  18. if [ -d $PRELUDE_INSTALL_DIR ]
  19. then
  20. printf "\e[33mfound an existing $PRELUDE_INSTALL_DIR.\e[0m Backing it up to $PRELUDE_INSTALL_DIR.pre-prelude.\n"
  21. mv $PRELUDE_INSTALL_DIR $PRELUDE_INSTALL_DIR.pre-prelude
  22. elif [ -f ~/.emacs ]
  23. then
  24. printf "\e[33mfound an existing ~/.emacs.\e[0m Backing it up to ~/.emacs.pre-prelude.\n"
  25. mv ~/.emacs ~/.emacs.pre-prelude
  26. else
  27. printf "\e[32mnot found.\e[0m\n"
  28. fi
  29. printf "Cloning Emacs Prelude from GitHub... "
  30. /usr/bin/env git clone $PRELUDE_URL $PRELUDE_INSTALL_DIR > /dev/null 2>&1
  31. cd $PRELUDE_INSTALL_DIR
  32. printf "done.\n"
  33. if which emacs 2>&1 > /dev/null
  34. then
  35. printf "Byte compiling Prelude... "
  36. emacs -batch -f batch-byte-compile $PRELUDE_INSTALL_DIR/prelude/*.el
  37. printf "done.\n\n"
  38. fi
  39. printf "\e[34m ____ _ _ \n"
  40. printf "\e[34m| _ \ _ __ ___| |_ _ __| | ___ \n"
  41. printf "\e[34m| |_) | __/ _ \ | | | |/ _ |/ _ \ \n"
  42. printf "\e[34m| __/| | | __/ | |_| | (_| | __/ \n"
  43. printf "\e[34m|_| |_| \___|_|\__,_|\__,_|\___| \n"
  44. printf "\e[32m... is now installed and ready to do thy bidding, Master $USER!\n"
  45. printf "\e[0m"