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.

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