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.

128 lines
4.4 KiB

14 years ago
  1. ;;; init.el --- Prelude's configuration entry point.
  2. ;;
  3. ;; Copyright (c) 2011 Bozhidar Batsov
  4. ;;
  5. ;; Author: Bozhidar Batsov <bozhidar@batsov.com>
  6. ;; URL: http://batsov.com/prelude
  7. ;; Version: 1.0.0
  8. ;; Keywords: convenience
  9. ;; This file is not part of GNU Emacs.
  10. ;;; Commentary:
  11. ;; This file simply sets up the default load path and requires
  12. ;; the various modules defined within Emacs Prelude.
  13. ;;; License:
  14. ;; This program is free software; you can redistribute it and/or
  15. ;; modify it under the terms of the GNU General Public License
  16. ;; as published by the Free Software Foundation; either version 3
  17. ;; of the License, or (at your option) any later version.
  18. ;;
  19. ;; This program is distributed in the hope that it will be useful,
  20. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. ;; GNU General Public License for more details.
  23. ;;
  24. ;; You should have received a copy of the GNU General Public License
  25. ;; along with GNU Emacs; see the file COPYING. If not, write to the
  26. ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  27. ;; Boston, MA 02110-1301, USA.
  28. ;;; Code:
  29. (message "Prelude is powering up... Be patient, Master %s!" (getenv "USER"))
  30. (defvar prelude-dir (file-name-directory load-file-name)
  31. "The root dir of the Emacs Prelude distribution.")
  32. (defvar prelude-core-dir (expand-file-name "core" prelude-dir)
  33. "The home of Prelude's core functionality.")
  34. (defvar prelude-modules-dir (expand-file-name "modules" prelude-dir)
  35. "This directory houses all of the built-in Prelude modules.")
  36. (defvar prelude-personal-dir (expand-file-name "personal" prelude-dir)
  37. "Users of Emacs Prelude are encouraged to keep their personal configuration
  38. changes in this directory. All Emacs Lisp files there are loaded automatically
  39. by Prelude.")
  40. (defvar prelude-vendor-dir (expand-file-name "vendor" prelude-dir)
  41. "This directory house Emacs Lisp packages that are not yet available in
  42. ELPA (or MELPA).")
  43. (defvar prelude-snippets-dir (expand-file-name "snippets" prelude-dir)
  44. "This folder houses additional yasnippet bundles distributed with Prelude.")
  45. (defvar prelude-personal-snippets-dir (expand-file-name prelude-personal-dir "snippets")
  46. "This folder houses additional yasnippet bundles added by the users.")
  47. (defvar prelude-savefile-dir (expand-file-name "savefile" prelude-dir)
  48. "This folder stores all the automatically generated save/history-files.")
  49. (unless (file-exists-p prelude-savefile-dir)
  50. (make-directory prelude-savefile-dir))
  51. (defun prelude-add-subfolders-to-load-path (parent-dir)
  52. "Adds all first level `parent-dir' subdirs to the
  53. Emacs load path."
  54. (dolist (f (directory-files parent-dir))
  55. (let ((name (expand-file-name f parent-dir)))
  56. (when (and (file-directory-p name)
  57. (not (equal f ".."))
  58. (not (equal f ".")))
  59. (add-to-list 'load-path name)))))
  60. ;; add Prelude's directories to Emacs's `load-path'
  61. (add-to-list 'load-path prelude-core-dir)
  62. (add-to-list 'load-path prelude-modules-dir)
  63. (add-to-list 'load-path prelude-vendor-dir)
  64. (prelude-add-subfolders-to-load-path prelude-vendor-dir)
  65. (require 'dash)
  66. ;; the core stuff
  67. (require 'prelude-packages)
  68. (require 'prelude-ui)
  69. (require 'prelude-core)
  70. (require 'prelude-mode)
  71. (require 'prelude-editor)
  72. (require 'prelude-global-keybindings)
  73. ;; OSX specific settings
  74. (when (eq system-type 'darwin)
  75. (require 'prelude-osx))
  76. ;; the modules
  77. (require 'prelude-programming)
  78. (require 'prelude-c)
  79. (require 'prelude-clojure)
  80. (require 'prelude-coffee)
  81. (require 'prelude-common-lisp)
  82. (require 'prelude-css)
  83. (require 'prelude-emacs-lisp)
  84. (require 'prelude-erc)
  85. (require 'prelude-erlang)
  86. (require 'prelude-haskell)
  87. (require 'prelude-js)
  88. (require 'prelude-latex)
  89. (require 'prelude-lisp)
  90. (require 'prelude-mediawiki)
  91. (require 'prelude-org)
  92. (require 'prelude-perl)
  93. (require 'prelude-python)
  94. (require 'prelude-ruby)
  95. (require 'prelude-scala)
  96. (require 'prelude-scheme)
  97. (require 'prelude-scss)
  98. (require 'prelude-xml)
  99. ;; config changes made through the customize UI will be store here
  100. (setq custom-file (expand-file-name "custom.el" prelude-personal-dir))
  101. ;; load the personal settings (this includes `custom-file')
  102. (when (file-exists-p prelude-personal-dir)
  103. (mapc 'load (directory-files prelude-personal-dir 't "^[^#].*el$")))
  104. (message "Prelude is ready to do thy bidding, Master %s!" (getenv "USER"))
  105. (prelude-eval-after-init
  106. ;; greet the use with some useful tip
  107. (run-at-time 5 nil 'prelude-tip-of-the-day))
  108. ;;; init.el ends here