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.

700 lines
26 KiB

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