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.

690 lines
26 KiB

12 years ago
12 years ago
13 years ago
11 years ago
14 years ago
14 years ago
11 years ago
12 years ago
12 years ago
12 years ago
  1. [![License GPL 3][badge-license]](http://www.gnu.org/licenses/gpl-3.0.txt)
  2. [![Gratipay](http://img.shields.io/gratipay/bbatsov.svg)](https://gratipay.com/bbatsov/)
  3. Emacs Prelude
  4. =============
  5. Prelude is an Emacs distribution that aims to enhance the default
  6. Emacs experience. Prelude alters a lot of the default settings,
  7. bundles a plethora of additional packages and adds its own core
  8. library to the mix. The final product offers an easy to use Emacs
  9. configuration for Emacs newcomers and lots of additional power for
  10. Emacs power users.
  11. Prelude is compatible **ONLY with GNU Emacs 24.x**. In general you're
  12. advised to always run Prelude with the latest Emacs - currently
  13. **24.4**.
  14. **Table of Contents**
  15. - [Fast Forward](#fast-forward)
  16. - [Installing Emacs 24](#installing-emacs-24)
  17. - [Installation](#installation)
  18. - [Automated](#automated)
  19. - [Via Curl](#via-curl)
  20. - [Via Wget](#via-wget)
  21. - [Manual](#manual)
  22. - [Updating Prelude](#updating-prelude)
  23. - [Manual update](#manual-update)
  24. - [Update all bundled packages](#update-all-bundled-packages)
  25. - [Update Prelude's code](#update-preludes-code)
  26. - [Restart Prelude](#restart-prelude)
  27. - [Automatic update](#automatic-update)
  28. - [Enabling additional modules](#enabling-additional-modules)
  29. - [Running](#running)
  30. - [Getting to know Prelude](#getting-to-know-prelude)
  31. - [Keymap](#keymap)
  32. - [Global](#global)
  33. - [Prelude Mode](#prelude-mode)
  34. - [OSX modifier keys](#osx-modifier-keys)
  35. - [Projectile](#projectile)
  36. - [Helm](#helm)
  37. - [Key-chords](#key-chords)
  38. - [Disabling key-chords](#disabling-key-chords)
  39. - [Automatic package installation](#automatic-package-installation)
  40. - [Color Themes](#color-themes)
  41. - [Personalizing](#personalizing)
  42. - [Disabling whitespace-mode](#disabling-whitespace-mode)
  43. - [Disable flyspell-mode](#disable-flyspell-mode)
  44. - [Caveats & Pitfalls](#caveats--pitfalls)
  45. - [Updating bundled packages](#updating-bundled-packages)
  46. - [Problems with flyspell-mode](#problems-with-flyspell-mode)
  47. - [Ugly colors in the terminal Emacs version](#ugly-colors-in-the-terminal-emacs-version)
  48. - [MELPA error on initial startup](#melpa-error-on-initial-startup)
  49. - [Warnings on arrow navigation in editor buffers](#warnings-on-navigation-in-editor-buffers)
  50. - [Customized C-a behavior](#customized-c-a-behavior)
  51. - [Poor ido matching performance on large datasets](#poor-ido-matching-performance-on-large-datasets)
  52. - [Windows compatibility](#windows-compatibility)
  53. - [Known issues](#known-issues)
  54. - [Support](#support)
  55. - [Contributors](#contributors)
  56. - [Bugs & Improvements](#bugs--improvements)
  57. ## Fast Forward
  58. Assuming you're using an Unix-like OS (`*BSD`, `GNU/Linux`, `OS X`, `Solaris`,
  59. etc), you already have Emacs 24 installed, as well as `git` & `curl` you
  60. can skip the whole manual and just type in your favorite shell the
  61. following command:
  62. ```bash
  63. curl -L http://git.io/epre | sh
  64. ```
  65. You can now power up your Emacs, sit back and enjoy Prelude,
  66. forgetting about the rest of this manual.
  67. There are two environment variables you can use to control the
  68. source repository and the installation directory. To change the
  69. installation directory:
  70. ```bash
  71. export PRELUDE_INSTALL_DIR="$HOME/.emacs.d" && curl -L https://github.com/bbatsov/prelude/raw/master/utils/installer.sh | sh
  72. ```
  73. To change the source repository:
  74. ```bash
  75. export PRELUDE_URL="https://github.com/yourname/prelude.git" && curl -L https://github.com/bbatsov/prelude/raw/master/utils/installer.sh | sh
  76. ```
  77. Note that the installer will back up any existing `.emacs` file or
  78. `.emacs.d` since it will unpack Prelude's code in `.emacs.d`. If
  79. you're doing a manual install make sure you don't have a `.emacs` file
  80. or back up your existing `.emacs.d` directory manually.
  81. Don't forget to adjust your `prelude-modules.el` file once the installation is done.
  82. By default most of the modules that ship with Prelude are not loaded.
  83. ## Installing Emacs 24
  84. Obviously to use the Emacs Prelude you have to install Emacs 24
  85. first. Have a look at the [WikEmacs articles on installing Emacs](http://wikemacs.org/index.php/Installing_Emacs).
  86. ## Installation
  87. ### Automated
  88. You can install **Emacs Prelude** via the command line with either `curl` or
  89. `wget`. Naturally `git` is also required.
  90. #### Via Curl
  91. If you're using `curl` type the following command:
  92. ```bash
  93. curl -L https://github.com/bbatsov/prelude/raw/master/utils/installer.sh | sh
  94. ```
  95. #### Via Wget
  96. If you're using `wget` type:
  97. ```bash
  98. wget --no-check-certificate https://github.com/bbatsov/prelude/raw/master/utils/installer.sh -O - | sh
  99. ```
  100. ### Manual
  101. ```bash
  102. git clone git://github.com/bbatsov/prelude.git path/to/local/repo
  103. ln -s path/to/local/repo ~/.emacs.d
  104. cd ~/.emacs.d
  105. ```
  106. If you are using Windows, you should check what Emacs thinks the `~` directory is by running Emacs and typing `C-x d ~/<RET>`, and then adjust the command appropriately.
  107. ## Updating Prelude
  108. ### Manual update
  109. The update procedure is fairly straightforward and consists of 3 steps:
  110. #### Update all bundled packages
  111. Just run <kbd>M-x package-list-packages RET U x</kbd>.
  112. #### Update Prelude's code
  113. ```bash
  114. cd path/to/prelude/installation
  115. git pull
  116. ```
  117. The `path/to/prelude/installation` is usually `~/.emacs.d` (at least
  118. on Unix systems).
  119. #### Restart Prelude
  120. It's generally a good idea to stop Emacs after you do the update. The
  121. next time Prelude starts it will install any new dependencies (if
  122. there are such).
  123. ### Automatic update
  124. Simply run <kbd>M-x prelude-update</kbd> from Emacs itself and restart Emacs afterwards.
  125. ## Enabling additional modules
  126. By default most of the modules that ship with Prelude are not loaded. For more information on the functionality provided by these modules visit the [docs](modules/doc/README.md).
  127. ```lisp
  128. ;;; Uncomment the modules you'd like to use and restart Prelude afterwards
  129. (require 'prelude-c)
  130. ;; (require 'prelude-clojure)
  131. ;; (require 'prelude-coffee)
  132. ;; (require 'prelude-common-lisp)
  133. ;; (require 'prelude-css)
  134. (require 'prelude-emacs-lisp)
  135. (require 'prelude-erc)
  136. ;; (require 'prelude-erlang)
  137. ;; (require 'prelude-elixir)
  138. ;; (require 'prelude-haskell)
  139. (require 'prelude-js)
  140. ;; (require 'prelude-latex)
  141. (require 'prelude-lisp)
  142. ;; (require 'prelude-mediawiki)
  143. (require 'prelude-org)
  144. (require 'prelude-perl)
  145. ;; (require 'prelude-python)
  146. ;; (require 'prelude-ruby)
  147. ;; (require 'prelude-scala)
  148. (require 'prelude-scheme)
  149. ;; (require 'prelude-scss)
  150. ;; (require 'prelude-web)
  151. (require 'prelude-xml)
  152. ```
  153. You'll need to adjust your `prelude-modules.el` file once the
  154. installation is done. If you are doing a manual install then you first
  155. need to copy the `prelude-modules.el` available in the sample
  156. directory to the root of `path/to/prelude/installation` and then
  157. adjust that one.
  158. After you've uncommented a module you should either restart Emacs or evaluate the module
  159. `require` expression with <kbd>C-x C-e</kbd>.
  160. ## Running
  161. Nothing fancy here. Just start Emacs as usual. Personally I run Emacs
  162. in daemon mode:
  163. ```bash
  164. emacs --daemon
  165. ```
  166. Afterwards I connect to the server with either a terminal or a GUI
  167. client like this:
  168. ```bash
  169. emacsclient -t
  170. emacsclient -c
  171. ```
  172. You'd probably do well to put a few aliases in your `.zshrc` (or
  173. `.bashrc`):
  174. ```bash
  175. alias e='emacsclient -t'
  176. alias ec='emacsclient -c'
  177. alias vim='emacsclient -t'
  178. alias vi='emacsclient -t'
  179. ```
  180. The last two aliases are helpful if you're used to editing files from
  181. the command line using `vi(m)`.
  182. Also you can open a file with cursor on choosen line:
  183. ```bash
  184. emacsclient somefile:1234
  185. ```
  186. This will open file 'somefile' and set cursor on line 1234.
  187. ## Getting to know Prelude
  188. Certainly the best way to understand how Prelude enhances the default
  189. Emacs experience is to peruse Prelude's source code (which is
  190. obviously written in Emacs Lisp). Understanding the code is not
  191. necessary of course. Prelude includes a `prelude-mode` minor Emacs mode
  192. which collects some of the additional functionality added by
  193. Prelude. It also adds an additional keymap that binds many of those
  194. extensions to keybindings.
  195. ### Keymap
  196. #### Global
  197. Keybinding | Description
  198. -------------------|------------------------------------------------------------
  199. <kbd>C-x \\</kbd> | `align-regexp`
  200. <kbd>C-+</kbd> | Increase font size(`text-scale-increase`).
  201. <kbd>C--</kbd> | Decrease font size(`text-scale-decrease`).
  202. <kbd>C-x O</kbd> | Go back to previous window (the inverse of `other-window` (`C-x o`)).
  203. <kbd>C-^</kbd> | Join two lines into one(`prelude-top-join-line`).
  204. <kbd>C-x p</kbd> | Start `proced` (manage processes from Emacs; works only in Linux).
  205. <kbd>C-x m</kbd> | Start `eshell`.
  206. <kbd>C-x M-m</kbd> | Start your default shell.
  207. <kbd>C-x C-m</kbd> | Alias for `M-x`.
  208. <kbd>M-X</kbd> | Like `M-x` but limited to commands that are relevant to the active major mode.
  209. <kbd>C-h A</kbd> | Run `apropos` (search in all Emacs symbols).
  210. <kbd>C-h C-m</kbd> | Display key bindings of current major mode and descriptions of every binding.
  211. <kbd>M-/</kbd> | Run `hippie-expand` (a replacement for the default `dabbrev-expand`).
  212. <kbd>C-x C-b</kbd> | Open `ibuffer` (a replacement for the default `buffer-list`).
  213. <kbd>F11</kbd> | Make the window full screen.
  214. <kbd>F12</kbd> | Toggle the Emacs menu bar.
  215. <kbd>C-x g</kbd> | Open Magit's status buffer.
  216. <kbd>M-Z</kbd> | Zap up to char.
  217. <kbd>C-c J</kbd> or <kbd>Super-></kbd> | Switch between buffers with [`ace-jump-buffer`](https://github.com/waymondo/ace-jump-buffer)
  218. <kbd>C-=</kbd> | Run `expand-region` (incremental text selection).
  219. <kbd>C-a</kbd> | Run `prelude-move-beginning-of-line`. Read [this](http://emacsredux.com/blog/2013/05/22/smarter-navigation-to-the-beginning-of-a-line/) for details.
  220. #### Prelude Mode
  221. Keybinding | Description
  222. -------------------|------------------------------------------------------------
  223. <kbd>C-c o</kbd> | Open the currently visited file with an external program.
  224. <kbd>C-c i</kbd> | Search for a symbol, only for buffers that contain code
  225. <kbd>C-c g</kbd> | Search in Google for the thing under point (or an interactive query).
  226. <kbd>C-c G</kbd> | Search in GitHub for the thing under point (or an interactive query).
  227. <kbd>C-c y</kbd> | Search in YouTube for the thing under point (or an interactive query).
  228. <kbd>C-c U</kbd> | Search in Duckduckgo for the thing under point (or an interactive query).
  229. <kbd>C-S-RET</kbd> or <kbd>Super-o</kbd> | Insert an empty line above the current line and indent it properly.
  230. <kbd>S-RET</kbd> or <kbd>M-o</kbd> | Insert an empty line and indent it properly (as in most IDEs).
  231. <kbd>C-S-up</kbd> or <kbd>M-S-up</kbd> | Move the current line or region up.
  232. <kbd>C-S-down</kbd> or <kbd>M-S-down</kbd>| Move the current line or region down.
  233. <kbd>C-c n</kbd> | Fix indentation in buffer and strip whitespace.
  234. <kbd>C-c f</kbd> | Open recently visited file.
  235. <kbd>C-M-\\</kbd> | Indent region (if selected) or the entire buffer.
  236. <kbd>C-c u</kbd> | Open a new buffer containing the contents of URL.
  237. <kbd>C-c e</kbd> | Eval a bit of Emacs Lisp code and replace it with its result.
  238. <kbd>C-c s</kbd> | Swap two active windows.
  239. <kbd>C-c D</kbd> | Delete current file and buffer.
  240. <kbd>C-c d</kbd> | Duplicate the current line (or region).
  241. <kbd>C-c M-d</kbd> | Duplicate and comment the current line (or region).
  242. <kbd>C-c r</kbd> | Rename the current buffer and its visiting file if any.
  243. <kbd>C-c t</kbd> | Open a terminal emulator (`ansi-term`).
  244. <kbd>C-c k</kbd> | Kill all open buffers except the one you're currently in.
  245. <kbd>C-c TAB</kbd> | Indent and copy region to clipboard
  246. <kbd>C-c I</kbd> | Open user's init file.
  247. <kbd>C-c S</kbd> | Open shell's init file.
  248. <kbd>C-c . +</kbd> | Increment integer at point. Default is +1.
  249. <kbd>C-c . -</kbd> | Decrement integer at point. Default is -1.
  250. <kbd>C-c . *</kbd> | Multiply integer at point. Default is *2.
  251. <kbd>C-c . /</kbd> | Divide integer at point. Default is /2.
  252. <kbd>C-c . \\</kbd> | Modulo integer at point. Default is modulo 2.
  253. <kbd>C-c . ^</kbd> | Power to the integer at point. Default is ^2.
  254. <kbd>C-c . <</kbd> | Left-shift integer at point. Default is 1 position to the left.
  255. <kbd>C-c . ></kbd> | Right-shift integer at point. Default is 1 position to the right.
  256. <kbd>C-c . #</kbd> | Convert integer at point to specified base. Default is 10.
  257. <kbd>C-c . %</kbd> | Replace integer at point with another specified integer.
  258. <kbd>C-c . '</kbd> | Perform arithmetic operations on integer at point. User specifies the operator.
  259. <kbd>Super-g</kbd> | Toggle between God mode and non-God mode
  260. <kbd>Super-r</kbd> | Recent files
  261. <kbd>Super-j</kbd> | Join lines
  262. <kbd>Super-k</kbd> | Kill whole line
  263. <kbd>Super-m m</kbd> | Magit status
  264. <kbd>Super-m l</kbd> | Magit log
  265. <kbd>Super-m f</kbd> | Magit file log
  266. <kbd>Super-m b</kbd> | Magit blame mode
  267. **Note**: For various arithmetic operations, the prefix `C-c .` only needs to be pressed once for the first operation.
  268. For subsequent operations, only the appropriate operations (i.e. `+`, `-`, `*`, `/`... needs to be pressed).
  269. #### OSX modifier keys
  270. Prelude does not mess by default with the standard mapping of `Command` (to `Super`) and `Option` (to `Meta`).
  271. If you want to swap them add this to your personal config:
  272. ```lisp
  273. (setq mac-command-modifier 'meta)
  274. (setq mac-option-modifier 'super)
  275. ```
  276. You can also temporarily swap them with `C-c w` (`M-x prelude-swap-meta-and-super`).
  277. #### Projectile
  278. Here's a list of functionality provided by [Projectile](https://github.com/bbatsov/projectile):
  279. Keybinding | Description
  280. -------------------|------------------------------------------------------------
  281. <kbd>C-c p f</kbd> | Display a list of all files in the project. With a prefix argument it will clear the cache first.
  282. <kbd>C-c p d</kbd> | Display a list of all directories in the project. With a prefix argument it will clear the cache first.
  283. <kbd>C-c p T</kbd> | Display a list of all test files(specs, features, etc) in the project.
  284. <kbd>C-c p s g</kbd> | Run grep on the files in the project.
  285. <kbd>M-- C-c p s g</kbd> | Run grep on `projectile-grep-default-files` in the project.
  286. <kbd>C-c p b</kbd> | Display a list of all project buffers currently open.
  287. <kbd>C-c p o</kbd> | Runs `multi-occur` on all project buffers currently open.
  288. <kbd>C-c p r</kbd> | Runs interactive query-replace on all files in the projects.
  289. <kbd>C-c p i</kbd> | Invalidates the project cache (if existing).
  290. <kbd>C-c p R</kbd> | Regenerates the projects `TAGS` file.
  291. <kbd>C-c p k</kbd> | Kills all project buffers.
  292. <kbd>C-c p D</kbd> | Opens the root of the project in `dired`.
  293. <kbd>C-c p e</kbd> | Shows a list of recently visited project files.
  294. <kbd>C-c p s a</kbd> | Runs `ack` on the project. Requires the presence of `ack-and-a-half`.
  295. <kbd>C-c p s s</kbd> | Runs `ag` on the project. Requires the presence of `ag.el`.
  296. <kbd>C-c p a</kbd> | Runs `ack` on the project. Requires the presence of `ack-and-a-half`.
  297. <kbd>C-c p c</kbd> | Runs a standard compilation command for your type of project.
  298. <kbd>C-c p P</kbd> | Runs a standard test command for your type of project.
  299. <kbd>C-c p z</kbd> | Adds the currently visited to the cache.
  300. <kbd>C-c p p</kbd> | Display a list of known projects you can switch to.
  301. Prelude adds an extra keymap prefix `S-p` (`S` stands for
  302. `Super`), so you can use `S-p` instead of `C-c p`.
  303. If you ever forget any of Projectile's keybindings just do a:
  304. <kbd>C-c p C-h</kbd>
  305. #### Helm
  306. Helm is setup according to this guide: [A Package in a league of its own: Helm](http://tuhdo.github.io/helm-intro.html).
  307. You can learn Helm usage and key bindings following the guide. <kbd>C-c h</kbd> is Prelude's default prefix key for Helm.
  308. If you don't remember any key binding, append <kbd>C-h</kbd> after <kbd>C-c h</kbd> for a list of key bindings in Helm.
  309. If you love Helm and want to use Helm globally with enhanced `helm-find-files`, `helm-buffer-lists`..., you will have to also add `(require 'prelude-helm-everywhere)`.
  310. When `prelude-helm-everywhere` is activated, Helm enables these global key bindings:
  311. Key binding | Description
  312. -------------------|----------------------------------------------
  313. <kbd>M-x</kbd> | Run [helm-M-x](http://tuhdo.github.io/helm-intro.html#sec-3), an interactive version of <kbd>M-x</kdb>.
  314. <kbd>M-y</kbd> | Run [helm-show-kill-ring](http://tuhdo.github.io/helm-intro.html#sec-4), shows the content of `kill-ring`.
  315. <kbd>C-x b </kbd> | Run [helm-mini](http://tuhdo.github.io/helm-intro.html#sec-5), an interactive version of `C-x b` with more features.
  316. <kbd>C-x C-f</kbd> | Run [helm-find-files](http://tuhdo.github.io/helm-intro.html#sec-6), an interactive version of `find-file` with more features.
  317. <kbd>C-h f </kbd> | Run [helm-apropos](http://tuhdo.github.io/helm-intro.html#sec-13), an interactive version of `apropos-command`.
  318. <kbd>C-h r</kbd> | Run [helm-info-emacs](http://tuhdo.github.io/helm-intro.html#sec-14), an interactive version of `info-emacs-manual`.
  319. <kbd>C-h C-l </kbd>| Run `helm-locate-library` that can search for locations of any file loaded into Emacs.
  320. This key binding is activated in `shell-mode`:
  321. Key Binding | Description
  322. -------------------|----------------------------------------------
  323. <kbd>C-c C-l</kbd> | Run `helm-comint-input-ring` that shows `shell` history using Helm interface.
  324. This key bindings is activated in `eshell-mode`:
  325. Key Binding | Description
  326. -------------------|----------------------------------------------
  327. <kbd>C-c C-l</kbd> | Run `helm-eshell-history` that shows `eshell` history using Helm interface.
  328. If you prefer Ido in everywhere, you should not add `prelude-helm-everywhere`, so you can use Helm along with Ido and Prelude's default commands.
  329. You can always reactivate Helm with `(prelude-global-helm-global-mode-on)`.
  330. **NOTICE**: In `helm-M-x`, you have to pass prefix argument *AFTER* you run `helm-M-x`,
  331. because your prefix argument will be displayed in the modeline when in `helm-M-x`
  332. buffer. Passing prefix argument **BEFORE** =helm-M-x= **has no effect**.
  333. #### Key-chords
  334. **Key-chords are available only when the `prelude-key-chord` module has been enabled.**
  335. Keybinding | Description
  336. -------------------|----------------------------------------------
  337. <kbd>jj</kbd> | Jump to the beginning of a word(`ace-jump-word-mode`)
  338. <kbd>jk</kbd> | Jump to a character(`ace-jump-char-mode`)
  339. <kbd>jl</kbd> | Jump to the beginning of a line(`ace-jump-line-mode`)
  340. <kbd>JJ</kbd> | Jump back to previous buffer(`prelude-switch-to-previous-buffer`)
  341. <kbd>uu</kbd> | View edits as a tree(`undo-tree-visualize`)
  342. <kbd>xx</kbd> | Executed extended command(`execute-extended-command`)
  343. <kbd>yy</kbd> | Browse the kill ring(`browse-kill-ring`)
  344. ##### Disabling key-chords
  345. In some cases you may not want to have a key-chord that is defined by prelude,
  346. in which case you can disable the binding in your `personal.el` file by setting
  347. its command to `nil`. For example, to disable the `jj` key-chord add the
  348. following line:
  349. ```lisp
  350. (key-chord-define-global "jj" nil)
  351. ```
  352. If you're an `evil-mode` user you'll probably do well to disable `key-chord-mode` altogether:
  353. ```lisp
  354. (key-chord-mode -1)
  355. ```
  356. #### vim emulation
  357. If you want to use vim inside of emacs enable the `prelude-evil` module which provides
  358. support for `evil-mode`.
  359. ## Automatic package installation
  360. The default Prelude installation comes with a bare minimum of
  361. functionality. It will however install add-ons for various programming
  362. languages and frameworks on demand. For instance - if you try to open
  363. a `.clj` file `clojure-mode`, `cider` and Prelude's enhanced Lisp
  364. configuration will be installed automatically for you.
  365. You can, of course, install anything you wish manually as well.
  366. ### Color Themes
  367. Emacs 24 ships with a new theming facility that effectively renders
  368. the old color-theme package obsolete. Emacs 24 provides a dozen of
  369. built-in themes you can use out-of-the-box by invoking the `M-x
  370. load-theme` command.
  371. [Zenburn](https://github.com/bbatsov/zenburn-emacs) is the default color theme in Prelude, but you can change it
  372. at your discretion. Why Zenburn? I (and lots of hackers around the
  373. world) find it pretty neat for some reason. Personally I find the
  374. default theme pretty tiresome for the eyes, that's why I took that
  375. "controversial" decision to replace it. You can, of course, easily go
  376. back to the default (or select another theme entirely).
  377. To disable Zenburn just put in your personal config the following
  378. line:
  379. ```lisp
  380. (disable-theme 'zenburn)
  381. ```
  382. Or you can use another theme altogether by adding something in `personal/preload` like:
  383. ```lisp
  384. (setq prelude-theme 'solarized-dark)
  385. ```
  386. **P.S.** Solarized is not available by default - you'll have to
  387. install it from MELPA first (`M-x package-install RET
  388. solarized-theme`).
  389. ### Personalizing
  390. Fork the official Prelude repo and add your own touch to it. You're advised to avoid changing stuff outside of the
  391. personal folder to avoid having to deal with git merge conflicts in the future.
  392. If you'd like to add some auto installation of packages in your
  393. personal config use the following code:
  394. ```lisp
  395. (prelude-require-packages '(some-package some-other-package))
  396. ```
  397. If you require just a single package you can also use:
  398. ```lisp
  399. (prelude-require-package 'some-package)
  400. ```
  401. #### Preloading personal config
  402. Sometimes you might want to load code before Prelude has started loading. Prelude will automatically preload all
  403. Emacs Lisp files in your `personal/preload` directory. Note that at this point you can't using anything from
  404. Prelude, except a few variables like `prelude-dir`, etc (since nothing is yet loaded).
  405. #### Disabling whitespace-mode
  406. Although `whitespace-mode` is awesome some people might find it too
  407. intrusive. You can disable it in your
  408. personal config with the following bit of code:
  409. ```lisp
  410. (setq prelude-whitespace nil)
  411. ```
  412. If you like `whitespace-mode` but prefer it to not automatically
  413. cleanup your file on save, you can disable that behavior by setting
  414. prelude-clean-whitespace-on-save to nil in your config file with:
  415. ```lisp
  416. (setq prelude-clean-whitespace-on-save nil)
  417. ```
  418. The prelude-clean-whitespace-on-save setting can also be set on a
  419. per-file or directory basis by using a file variable or a
  420. .dir-locals.el file.
  421. #### Disable flyspell-mode
  422. If you're not fond of spellchecking on the fly:
  423. ```lisp
  424. (setq prelude-flyspell nil)
  425. ```
  426. ## Caveats & Pitfalls
  427. ### Updating bundled packages
  428. Generally it's a good idea to do a package update before running
  429. updating Prelude, since the latest Prelude code might depend on newer
  430. versions of the bundled packages than you would currently have
  431. installed.
  432. If you're doing manual Prelude updates you should always do a package update first.
  433. `M-x package-list-packages RET U x`
  434. That's not necessary if you're using `M-x prelude-update`, since it
  435. will automatically update the installed packages.
  436. ### Problems with flyspell-mode
  437. Prelude makes heavy use of the flyspell-mode package for spell
  438. checking of various things. The proper operation of flyspell depends
  439. on the presence of the `aspell` program and an `en` dictionary on your
  440. system. You can install `aspell` and the dictionary on OS X with
  441. `homebrew` like this:
  442. ```bash
  443. brew install aspell --with-lang=en
  444. ```
  445. On Linux distros - just use your distro's package manager.
  446. ### Ugly colors in the terminal Emacs version
  447. If your Emacs looks considerably uglier in a terminal (compared to the
  448. GUI version) try adding this to your `.bashrc` or `.zshrc`:
  449. ```bash
  450. export TERM=xterm-256color
  451. ```
  452. Source the `.bashrc` file and start Emacs again.
  453. ### MELPA error on initial startup
  454. If you get some http connection error related to the MELPA repo
  455. just do a manual `M-x package-refresh-contents` and restart Emacs
  456. afterwards.
  457. ### Warnings on arrow navigation in editor buffers
  458. This is not a bug - it's a feature! I firmly believe that the one true
  459. way to use Emacs is by using it the way it was intended to be used (as
  460. far as navigation is concerned at least).
  461. If you'd like to be take this a step further and disable the arrow key navigation
  462. completely put this in your personal config:
  463. ```lisp
  464. (setq guru-warn-only nil)
  465. ```
  466. To disable `guru-mode` completely add the following snippet to your
  467. personal Emacs config:
  468. ```lisp
  469. (setq prelude-guru nil)
  470. ```
  471. ### Customized C-a behavior
  472. Prelude overrides `C-a` to behave as described
  473. [here](http://emacsredux.com/blog/2013/05/22/smarter-navigation-to-the-beginning-of-a-line/). If
  474. you don't like that simply add this to your personal config:
  475. ```lisp
  476. (global-set-key [remap move-beginning-of-line]
  477. 'move-beginning-of-line)
  478. ```
  479. ### Poor ido matching performance on large datasets
  480. Prelude swaps the default `ido` flex matching with the more powerful
  481. [ido-flx](https://github.com/lewang/flx).
  482. The sorting algorithm `flx` uses is more complex, but yields better results.
  483. On slower machines, it may be necessary to lower `flx-ido-threshold` to
  484. ensure a smooth experience.
  485. ```lisp
  486. (setq flx-ido-threshold 1000)
  487. ```
  488. You can always disable the improved sorting algorithm all together like this:
  489. ```lisp
  490. (flx-ido-mode -1)
  491. ```
  492. ### Windows compatibility
  493. While everything in Prelude should work fine in Windows, I test it only
  494. with Linux & OSX, so there are Windows related problems from time to
  495. time. This situation will probably improve over time.
  496. ## Known issues
  497. Check out the project's
  498. [issue list](https://github.com/bbatsov/prelude/issues?sort=created&direction=desc&state=open)
  499. a list of unresolved issues. By the way - feel free to fix any of them
  500. and send me a pull request. :-)
  501. ## Support
  502. Support is available via the Prelude Google Group <emacs-prelude@googlegroups.com>.
  503. There's also a Freenode channel you can visit - `#prelude-emacs`.
  504. ## Contributors
  505. Here's a [list](https://github.com/bbatsov/prelude/contributors) of all the people who have contributed to the
  506. development of Emacs Prelude.
  507. ## Bugs & Improvements
  508. Bug reports and suggestions for improvements are always
  509. welcome. GitHub pull requests are even better! :-)
  510. I'm also accepting financial contributions via [gittip](https://www.gittip.com/bbatsov).
  511. [![Support via Gittip](https://rawgithub.com/twolfson/gittip-badge/0.2.0/dist/gittip.png)](https://www.gittip.com/bbatsov)
  512. Cheers,<br/>
  513. [Bozhidar](https://twitter.com/bbatsov)
  514. [badge-license]: https://img.shields.io/badge/license-GPL_3-green.svg