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.

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