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.

254 lines
8.1 KiB

14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
  1. ```
  2. ____ _ _
  3. | _ \ _ __ ___| |_ _ __| | ___
  4. | |_) | '__/ _ \ | | | |/ _` |/ _ \
  5. | __/| | | __/ | |_| | (_| | __/
  6. |_| |_| \___|_|\__,_|\__,_|\___|
  7. ```
  8. ## Prelude
  9. Emacs is probably the best text editor in the world. However, the
  10. process of coming up with a useful Emacs configuration is long and
  11. difficult. It's this process that separates you from truly taking
  12. advantage of Emacs's power. I like to refer to this process as the
  13. **Prelude**. The **Emacs Prelude** has the goal to ease the initial
  14. Emacs setup process and to provide you with a much more powerful and
  15. productive experience than that you get out of the box. By using **Emacs
  16. Prelude** you're basically getting a "Get me out of the Prelude, I
  17. just want to use Emacs" card.
  18. Emacs Prelude is compatible **ONLY with GNU Emacs 24.x**.
  19. ## Fast Forward
  20. Assuming you're using an Unix-like OS (`*BSD`, `GNU/Linux`, `OS X`, `Solaris`,
  21. etc), you already have Emacs 24 installed, as well as `git` & `curl` you
  22. can skip the whole manual and just type in your favorite shell the
  23. following command:
  24. `curl -L https://github.com/bbatsov/prelude/raw/master/utils/installer.sh | sh`
  25. You can now power up your Emacs, sit back and enjoy Prelude,
  26. forgetting about the rest of this manual.
  27. There are two environment variables you can use to control the
  28. source repository and the installation directory. To change the
  29. installation directory:
  30. `PRELUDE_INSTALL_DIR="$HOME/.emacs.d" &&
  31. curl -L
  32. https://github.com/bbatsov/prelude/raw/master/utils/installer.sh
  33. | sh`
  34. To change the source repository:
  35. `PRELUDE_URL="https://github.com/yourname/prelude.git" &&
  36. curl -L
  37. https://github.com/bbatsov/prelude/raw/master/utils/installer.sh
  38. | sh`
  39. Note that the installer will back up any existing `.emacs` file or
  40. `.emacs.d` since it will unpack Prelude's code in `.emacs.d`. If
  41. you're doing a manual install make sure you don't have a `.emacs` file
  42. or back up your existing `.emacs.d` directory manually.
  43. ## More goodies
  44. The [Prelude Modules](https://github.com/bbatsov/prelude-modules)
  45. project contains a lot of additional packages for Prelude
  46. (install-able via the `package-list-packages` command) - enhanced programming
  47. mode configs, latex config, erc config, etc.
  48. ## Installing Emacs 24
  49. Obviously to use the Emacs Prelude you have to install Emacs 24
  50. first. Have a look at the [WikEmacs articles on installing Emacs](http://wikemacs.org/wiki/Installing_Emacs).
  51. ## Installation
  52. ### Automated
  53. You can install Emacs via the command line with either `curl` or
  54. `wget`. Naturally `git` is also required.
  55. #### Via Curl
  56. If you're using `curl` type the following command:
  57. `curl -L https://github.com/bbatsov/prelude/raw/master/utils/installer.sh | sh`
  58. #### Via Wget
  59. If you're using `wget` type:
  60. `wget --no-check-certificate https://github.com/bbatsov/prelude/raw/master/utils/installer.sh -O - | sh`
  61. ### Manual
  62. ```bash
  63. $ git clone git://github.com/bbatsov/prelude.git path/to/local/repo
  64. $ ln -s path/to/local/repo ~/.emacs.d
  65. $ cd ~/emacs.d
  66. ```
  67. You'd do well to replace `~/.emacs.d` with the value of
  68. `user-emacs-directory` for your OS. You can check the value by doing
  69. `C-h v user-emacs-directory` inside Emacs.
  70. ## Running
  71. Nothing fancy here. Just start Emacs as usual. Personally I run Emacs
  72. in daemon mode:
  73. `$ emacs --daemon`
  74. Afterwards I connect to the server with either a terminal or a GUI
  75. client like this:
  76. ```bash
  77. $ emacsclient -t
  78. $ emacsclient -c
  79. ```
  80. You'd probably do well to put a few aliases in your `.zshrc` (or
  81. `.bashrc`):
  82. ```bash
  83. alias e=emacsclient -t
  84. alias ec=emacsclient -c
  85. alias vim=emacsclient -t
  86. alias vi=emacsclient -t
  87. ```
  88. The last two aliases are helpful if you're used to editing files from
  89. the command line using `vi(m)`.
  90. ## Getting to know Prelude
  91. Certainly the best way to understand how Prelude enhances the default
  92. Emacs experience is to peruse Prelude's source code (which is
  93. obviously written in Emacs Lisp). If you're intimidated by the source
  94. - do not despair. Prelude includes a `prelude-mode` minor Emacs mode
  95. which collects some of the additional functionality added by
  96. Prelude. It also adds an additional keymap that binds many of those
  97. extensions to keybindings.
  98. ## Color Themes
  99. Emacs 24 ships with a new theming facility that effectively renders
  100. the old color-theme package obsolete. Emacs 24 provides a dozen of
  101. built-in themes you can use out-of-the-box by invoking the `M-x
  102. load-theme` command.
  103. [Zenburn](https://github.com/bbatsov/zenburn-emacs) is the default color theme in Prelude, but you can change it
  104. at your discretion. Why Zenburn? I (and lots of hackers around the
  105. world) find it pretty neat for some reason. Personally I find the
  106. default theme pretty tiresome for the eyes, that's why I took that
  107. "controversial" decision to replace it. You can, of course, easily go
  108. back to the default (or select another theme entirely).
  109. To disable Zenburn just put in your personal config the following
  110. line:
  111. ```elisp
  112. (disable-theme 'zenburn)
  113. ```
  114. Or you can use another theme altogether by adding something like:
  115. ```elisp
  116. (load-theme 'solarized-dark t)
  117. ```
  118. P.S. Solarized is not available by default - you'll have to install it from MELPA first.
  119. ## Personalizing
  120. Fork the official Prelude repo and add your own touch to it. You're advised to avoid changing stuff outside of the
  121. personal folder to avoid having to deal with git merge conflicts in the future.
  122. ## Prelude Modules
  123. Additional settings for various programming languages are available for installation via MELPA. You might take a look at the [Prelude Modules project](https://github.com/bbatsov/prelude-modules) for further info.
  124. ## Caveats & Pitfalls
  125. ### Problems with flyspell-mode
  126. Prelude makes heavy use of the flyspell-mode package for spell
  127. checking of various things. The proper operation of flyspell depends
  128. on the presence of the `aspell` program and an `en` dictionary on your
  129. system. You can install `aspell` and the dictionary on OS X with
  130. `homebrew` like this:
  131. ```bash
  132. $ brew install aspell --lang=en
  133. ```
  134. On Linux distros - just use your distro's package manager.
  135. ### Ugly colors in the terminal Emacs version
  136. If your Emacs looks considerably uglier in a terminal (compared to the
  137. GUI version) try adding this to your `.bashrc` or `.zshrc`:
  138. ```bash
  139. export TERM=xterm-256color
  140. ```
  141. Source the `.bashrc` file and start Emacs again.
  142. ### MELPA error on initial startup
  143. If you get some http connection error related to the MELPA repo
  144. just do a manual `M-x package-refresh-contents` and restart Emacs
  145. afterwards.
  146. ### No arrow navigation in editor buffers
  147. This is not a bug - it's a feature! I firmly believe that the one true
  148. way to use Emacs is by using it the way it was intended to be used (as
  149. far as navigation is concerned at least). That's why I've disabled all
  150. movement commands with arrows (and keys like page up, page down, etc) - to prevent you from being tempted to
  151. use them.
  152. If you'd still like to use the arrow keys just invoke `M-x
  153. guru-mode` to enable them for the duration of your
  154. current Emacs session or add `(guru-mode -1)` to your
  155. personal Emacs customization to enable them permanently.
  156. ### Windows compatibility
  157. While everything in Prelude should work fine in Windows, I test it only
  158. with Linux & OSX, so there are Windows related problems from time to
  159. time. This situation will probably improve over time.
  160. ## Share the knowledge
  161. [WikEmacs](http://wikemacs.org) collects useful resources for working
  162. with GNU Emacs. Please, take the time to peruse and improve them as
  163. you accumulate knowledge about Emacs. Prelude makes this especially
  164. easy, since it bundles
  165. [MediaWiki support](http://wikemacs.org/wiki/Mediawiki.el) + the
  166. settings required to access WikEmacs right away.
  167. ## Known issues
  168. Check out the project's
  169. [issue list](https://github.com/bbatsov/prelude/issues?sort=created&direction=desc&state=open)
  170. a list of unresolved issues. By the way - feel free to fix any of them
  171. and sent me a pull request. :-)
  172. ## Contributors
  173. Here's a [list](https://github.com/bbatsov/prelude/contributors) of all the people who have contributed to the
  174. development of Emacs Prelude.
  175. ## Bugs & Improvements
  176. Bug reports and suggestions for improvements are always
  177. welcome. github pull requests are even better! :-)
  178. Cheers,<br>
  179. Bozhidar