2014-05-26 19:06:52 +03:00
[![License GPL 3][badge-license]](http://www.gnu.org/licenses/gpl-3.0.txt)
2016-06-02 16:43:18 +03:00
[![Gratipay Team ](https://img.shields.io/gratipay/team/prelude.svg?maxAge=2592000 )](https://gratipay.com/prelude/)
2014-04-25 09:35:04 +03:00
2012-09-16 14:52:48 +03:00
Emacs Prelude
=============
2012-09-05 13:41:54 +03:00
2015-03-03 23:17:40 +02:00
[![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)
2013-03-17 11:58:17 +02:00
Prelude is an Emacs distribution that aims to enhance the default
Emacs experience. Prelude alters a lot of the default settings,
bundles a plethora of additional packages and adds its own core
library to the mix. The final product offers an easy to use Emacs
configuration for Emacs newcomers and lots of additional power for
Emacs power users.
2011-10-08 00:55:49 +03:00
2016-04-29 02:12:53 +03:00
Prelude is compatible **ONLY with GNU Emacs 24.4+** . In general you're
2013-04-21 22:31:56 +03:00
advised to always run Prelude with the latest Emacs - currently
2017-05-08 00:41:38 +03:00
**25.2**.
2011-10-08 00:55:49 +03:00
2016-05-28 14:30:42 +03:00
You can support the development of Prelude via
2016-10-06 13:26:07 +03:00
[Salt ](https://bountysource.com/teams/prelude ) and
2016-05-28 14:30:42 +03:00
[Gratipay ](https://www.gratipay.com/prelude ).
[![Support via Gratipay ](https://cdn.rawgit.com/gratipay/gratipay-badge/2.1.3/dist/gratipay.png )](https://gratipay.com/prelude)
2013-10-29 17:04:57 +02:00
**Table of Contents**
- [Fast Forward ](#fast-forward )
2016-10-03 08:58:09 +03:00
- [Installing Emacs ](#installing-emacs )
2013-10-29 17:04:57 +02:00
- [Installation ](#installation )
2015-03-03 13:02:57 +02:00
- [Automated ](#automated )
- [Via Curl ](#via-curl )
- [Via Wget ](#via-wget )
- [Manual ](#manual )
2013-10-29 17:04:57 +02:00
- [Updating Prelude ](#updating-prelude )
2015-03-03 13:02:57 +02:00
- [Manual update ](#manual-update )
- [Update all bundled packages ](#update-all-bundled-packages )
- [Update Prelude's code ](#update-preludes-code )
- [Restart Prelude ](#restart-prelude )
- [Automatic update ](#automatic-update )
2013-10-29 17:04:57 +02:00
- [Enabling additional modules ](#enabling-additional-modules )
- [Running ](#running )
- [Getting to know Prelude ](#getting-to-know-prelude )
2015-03-03 13:02:57 +02:00
- [Keymap ](#keymap )
- [Global ](#global )
- [Prelude Mode ](#prelude-mode )
- [OSX modifier keys ](#osx-modifier-keys )
- [Projectile ](#projectile )
- [Helm ](#helm )
- [Key-chords ](#key-chords )
- [Disabling key-chords ](#disabling-key-chords )
2013-10-29 17:04:57 +02:00
- [Automatic package installation ](#automatic-package-installation )
2015-03-03 13:02:57 +02:00
- [Color Themes ](#color-themes )
- [Personalizing ](#personalizing )
- [Disabling whitespace-mode ](#disabling-whitespace-mode )
- [Disable flyspell-mode ](#disable-flyspell-mode )
2013-10-29 17:04:57 +02:00
- [Caveats & Pitfalls ](#caveats--pitfalls )
2015-03-03 13:02:57 +02:00
- [Updating bundled packages ](#updating-bundled-packages )
- [Problems with flyspell-mode ](#problems-with-flyspell-mode )
- [Ugly colors in the terminal Emacs version ](#ugly-colors-in-the-terminal-emacs-version )
- [MELPA error on initial startup ](#melpa-error-on-initial-startup )
2016-06-04 01:27:45 +03:00
- [Warnings on arrow navigation in editor buffers ](#warnings-on-arrow-navigation-in-editor-buffers )
2015-03-03 13:02:57 +02:00
- [Customized C-a behavior ](#customized-c-a-behavior )
- [Poor ido matching performance on large datasets ](#poor-ido-matching-performance-on-large-datasets )
- [Windows compatibility ](#windows-compatibility )
2013-10-29 17:04:57 +02:00
- [Known issues ](#known-issues )
- [Support ](#support )
- [Contributors ](#contributors )
- [Bugs & Improvements ](#bugs--improvements )
2012-09-16 14:52:48 +03:00
## Fast Forward
2012-02-17 15:07:54 +02:00
2012-02-24 15:22:39 +02:00
Assuming you're using an Unix-like OS (`*BSD`, `GNU/Linux` , `OS X` , `Solaris` ,
2016-10-03 08:58:09 +03:00
etc), you already have Emacs 24.4+ installed, as well as `git` & `curl` you
2012-02-17 15:07:54 +02:00
can skip the whole manual and just type in your favorite shell the
following command:
2012-09-16 13:16:37 +03:00
```bash
2015-06-04 19:42:29 +03:00
curl -L https://git.io/epre | sh
2012-09-16 13:16:37 +03:00
```
2012-02-17 15:14:32 +02:00
2012-09-05 13:41:54 +03:00
You can now power up your Emacs, sit back and enjoy Prelude,
forgetting about the rest of this manual.
2012-02-17 15:07:54 +02:00
2013-01-07 14:48:14 +02:00
There are two environment variables you can use to control the
source repository and the installation directory. To change the
2012-06-08 22:00:32 +03:00
installation directory:
2012-06-08 21:56:15 +03:00
2012-09-16 13:16:37 +03:00
```bash
2013-06-01 20:57:39 +03:00
export PRELUDE_INSTALL_DIR="$HOME/.emacs.d" & & curl -L https://github.com/bbatsov/prelude/raw/master/utils/installer.sh | sh
2012-09-16 13:16:37 +03:00
```
2012-06-08 22:00:32 +03:00
To change the source repository:
2012-09-16 13:16:37 +03:00
```bash
2013-06-01 20:57:39 +03:00
export PRELUDE_URL="https://github.com/yourname/prelude.git" & & curl -L https://github.com/bbatsov/prelude/raw/master/utils/installer.sh | sh
2012-09-16 13:16:37 +03:00
```
2012-06-08 21:56:15 +03:00
2012-06-14 14:28:28 +03:00
Note that the installer will back up any existing `.emacs` file or
`.emacs.d` since it will unpack Prelude's code in `.emacs.d` . If
you're doing a manual install make sure you don't have a `.emacs` file
or back up your existing `.emacs.d` directory manually.
2012-06-08 21:56:15 +03:00
2013-01-13 20:42:17 +02:00
Don't forget to adjust your `prelude-modules.el` file once the installation is done.
By default most of the modules that ship with Prelude are not loaded.
2016-10-03 08:58:09 +03:00
## Installing Emacs
2012-09-05 13:41:54 +03:00
2016-10-03 08:58:09 +03:00
Obviously to use the Emacs Prelude you have to install Emacs
first. Have a look at
the
[WikEmacs articles on installing Emacs ](http://wikemacs.org/index.php/Installing_Emacs ).
2013-01-07 14:48:14 +02:00
2012-09-16 14:52:48 +03:00
## Installation
2012-09-05 13:41:54 +03:00
2012-09-16 14:52:48 +03:00
### Automated
2012-09-05 13:41:54 +03:00
2012-09-17 00:31:11 +03:00
You can install **Emacs Prelude** via the command line with either `curl` or
2012-09-05 13:41:54 +03:00
`wget` . Naturally `git` is also required.
2012-09-16 14:52:48 +03:00
#### Via Curl
2012-09-05 13:41:54 +03:00
If you're using `curl` type the following command:
2012-09-16 13:16:37 +03:00
```bash
2013-06-01 20:57:39 +03:00
curl -L https://github.com/bbatsov/prelude/raw/master/utils/installer.sh | sh
2012-09-16 13:16:37 +03:00
```
2012-09-05 13:41:54 +03:00
2012-09-16 14:52:48 +03:00
#### Via Wget
2012-09-05 13:41:54 +03:00
If you're using `wget` type:
2012-09-16 13:16:37 +03:00
```bash
2013-06-01 20:57:39 +03:00
wget --no-check-certificate https://github.com/bbatsov/prelude/raw/master/utils/installer.sh -O - | sh
2012-09-16 13:16:37 +03:00
```
2012-09-05 13:41:54 +03:00
2012-09-16 14:52:48 +03:00
### Manual
2012-09-05 13:41:54 +03:00
2017-07-16 14:33:25 +03:00
Make sure you do not have any `~/.emacs` file present.
2012-09-05 13:41:54 +03:00
```bash
2013-06-01 20:57:39 +03:00
git clone git://github.com/bbatsov/prelude.git path/to/local/repo
ln -s path/to/local/repo ~/.emacs.d
cd ~/.emacs.d
2012-09-05 13:41:54 +03:00
```
2014-06-16 09:27:53 +03:00
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.
2012-09-05 13:41:54 +03:00
2013-03-06 19:07:17 +02:00
## Updating Prelude
2013-10-22 15:37:05 +03:00
### Manual update
2013-09-27 11:09:40 +03:00
The update procedure is fairly straightforward and consists of 3 steps:
2013-10-22 15:37:05 +03:00
#### Update all bundled packages
2013-09-27 11:09:40 +03:00
2013-10-22 15:37:05 +03:00
Just run < kbd > M-x package-list-packages RET U x< / kbd > .
2013-09-27 11:09:40 +03:00
2013-10-22 15:37:05 +03:00
#### Update Prelude's code
2013-03-06 19:07:17 +02:00
```bash
2013-06-01 20:57:39 +03:00
cd path/to/prelude/installation
git pull
2013-03-06 19:07:17 +02:00
```
The `path/to/prelude/installation` is usually `~/.emacs.d` (at least
on Unix systems).
2013-10-22 15:37:05 +03:00
#### Restart Prelude
2013-09-27 11:09:40 +03:00
It's generally a good idea to stop Emacs after you do the update. The
2013-03-06 19:07:17 +02:00
next time Prelude starts it will install any new dependencies (if
there are such).
2013-10-22 15:37:05 +03:00
### Automatic update
Simply run < kbd > M-x prelude-update< / kbd > from Emacs itself and restart Emacs afterwards.
2017-01-04 09:17:48 +02:00
## Pinning packages
By default, Prelude will install packages from the melpa and gnu package
repositories. Occasionally package integration can break when upgrading packages.
This can be avoided by pinning packages to stable versions in other repositories.
To do so, copy `prelude-pinned-packages.el` from the sample directory to
Prelude's root directory and adjust the [variables ](https://www.gnu.org/software/emacs/manual/html_node/emacs/Package-Installation.html )
inside accordingly.
2013-01-13 20:42:17 +02:00
## Enabling additional modules
2013-10-10 17:25:19 +03:00
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 ).
2013-01-13 20:42:17 +02:00
```lisp
;;; Uncomment the modules you'd like to use and restart Prelude afterwards
(require 'prelude-c)
;; (require 'prelude-clojure)
;; (require 'prelude-coffee)
;; (require 'prelude-common-lisp)
;; (require 'prelude-css)
(require 'prelude-emacs-lisp)
(require 'prelude-erc)
;; (require 'prelude-erlang)
2014-12-12 23:28:32 +02:00
;; (require 'prelude-elixir)
2013-01-13 20:42:17 +02:00
;; (require 'prelude-haskell)
(require 'prelude-js)
;; (require 'prelude-latex)
(require 'prelude-lisp)
;; (require 'prelude-mediawiki)
(require 'prelude-org)
(require 'prelude-perl)
;; (require 'prelude-python)
;; (require 'prelude-ruby)
;; (require 'prelude-scala)
(require 'prelude-scheme)
;; (require 'prelude-scss)
2013-08-01 18:23:37 +03:00
;; (require 'prelude-web)
2013-01-13 20:42:17 +02:00
(require 'prelude-xml)
```
2013-04-15 18:28:31 +03:00
You'll need to adjust your `prelude-modules.el` file once the
installation is done. If you are doing a manual install then you first
need to copy the `prelude-modules.el` available in the sample
directory to the root of `path/to/prelude/installation` and then
adjust that one.
2013-01-13 20:42:17 +02:00
2013-03-11 20:16:01 +02:00
After you've uncommented a module you should either restart Emacs or evaluate the module
`require` expression with < kbd > C-x C-e</ kbd > .
2012-09-16 14:52:48 +03:00
## Running
2012-09-05 13:41:54 +03:00
Nothing fancy here. Just start Emacs as usual. Personally I run Emacs
in daemon mode:
2012-09-16 13:16:37 +03:00
```bash
2013-06-01 20:57:39 +03:00
emacs --daemon
2012-09-16 13:16:37 +03:00
```
2012-09-05 13:41:54 +03:00
Afterwards I connect to the server with either a terminal or a GUI
client like this:
```bash
2013-06-01 20:57:39 +03:00
emacsclient -t
emacsclient -c
2012-09-05 13:41:54 +03:00
```
You'd probably do well to put a few aliases in your `.zshrc` (or
`.bashrc` ):
```bash
2013-11-21 11:46:18 +02:00
alias e='emacsclient -t'
alias ec='emacsclient -c'
alias vim='emacsclient -t'
alias vi='emacsclient -t'
2012-09-05 13:41:54 +03:00
```
The last two aliases are helpful if you're used to editing files from
the command line using `vi(m)` .
2014-10-26 13:44:24 +02:00
Also you can open a file with cursor on choosen line:
```bash
emacsclient somefile:1234
```
This will open file 'somefile' and set cursor on line 1234.
2012-09-16 14:52:48 +03:00
## Getting to know Prelude
2012-09-05 13:41:54 +03:00
Certainly the best way to understand how Prelude enhances the default
Emacs experience is to peruse Prelude's source code (which is
2012-09-16 14:52:48 +03:00
obviously written in Emacs Lisp). Understanding the code is not
necessary of course. Prelude includes a `prelude-mode` minor Emacs mode
2012-09-05 13:41:54 +03:00
which collects some of the additional functionality added by
Prelude. It also adds an additional keymap that binds many of those
extensions to keybindings.
2012-12-08 15:23:33 +02:00
### Keymap
#### Global
2013-03-10 19:44:10 +02:00
Keybinding | Description
-------------------|------------------------------------------------------------
2013-03-31 14:31:40 +03:00
< kbd > C-x \\</ kbd > | `align-regexp`
2013-03-10 19:44:10 +02:00
< kbd > C-+< / kbd > | Increase font size(`text-scale-increase`).
< kbd > C--< / kbd > | Decrease font size(`text-scale-decrease`).
< kbd > C-x O</ kbd > | Go back to previous window (the inverse of `other-window` (`C-x o`)).
2016-05-03 06:14:31 +03:00
< kbd > C-^< / kbd > | Join two lines into one(`crux-top-join-line`).
2013-04-09 16:28:00 +03:00
< kbd > C-x p</ kbd > | Start `proced` (manage processes from Emacs; works only in Linux).
2013-03-10 19:44:10 +02:00
< kbd > C-x m</ kbd > | Start `eshell` .
< kbd > C-x M-m< / kbd > | Start your default shell.
< kbd > C-x C-m</ kbd > | Alias for `M-x` .
2014-08-25 13:27:20 +03:00
< kbd > M-X</ kbd > | Like `M-x` but limited to commands that are relevant to the active major mode.
2013-03-10 19:44:10 +02:00
< kbd > C-h A</ kbd > | Run `apropos` (search in all Emacs symbols).
2014-05-29 07:04:44 +03:00
< kbd > C-h C-m< / kbd > | Display key bindings of current major mode and descriptions of every binding.
2013-06-30 16:11:00 +03:00
< kbd > M-/</ kbd > | Run `hippie-expand` (a replacement for the default `dabbrev-expand` ).
2013-03-10 19:44:10 +02:00
< kbd > C-x C-b</ kbd > | Open `ibuffer` (a replacement for the default `buffer-list` ).
2013-07-25 20:01:02 +03:00
< kbd > F11< / kbd > | Make the window full screen.
2013-03-10 19:44:10 +02:00
< kbd > F12< / kbd > | Toggle the Emacs menu bar.
< kbd > C-x g< / kbd > | Open Magit's status buffer.
2015-06-27 17:19:57 +03:00
< kbd > C-x M-g< / kbd > | Open Magit's popup of popups.
2014-08-26 14:34:28 +03:00
< kbd > M-Z< / kbd > | Zap up to char.
2013-03-10 19:44:10 +02:00
< kbd > C-=</ kbd > | Run `expand-region` (incremental text selection).
2016-05-06 10:05:49 +03:00
< 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.
2012-12-08 15:23:33 +02:00
#### Prelude Mode
2013-03-10 19:44:10 +02:00
Keybinding | Description
-------------------|------------------------------------------------------------
< kbd > C-c o< / kbd > | Open the currently visited file with an external program.
2013-10-07 20:33:23 +03:00
< kbd > C-c i< / kbd > | Search for a symbol, only for buffers that contain code
2013-03-10 19:44:10 +02:00
< kbd > C-c g< / kbd > | Search in Google for the thing under point (or an interactive query).
2013-09-15 08:53:08 +03:00
< kbd > C-c G< / kbd > | Search in GitHub for the thing under point (or an interactive query).
2013-08-26 17:58:02 +03:00
< kbd > C-c y< / kbd > | Search in YouTube for the thing under point (or an interactive query).
2014-05-27 07:19:01 +03:00
< kbd > C-c U< / kbd > | Search in Duckduckgo for the thing under point (or an interactive query).
2013-10-31 23:11:12 +02:00
< kbd > C-S-RET< / kbd > or < kbd > Super-o< / kbd > | Insert an empty line above the current line and indent it properly.
2013-10-24 18:43:12 +03:00
< kbd > S-RET< / kbd > or < kbd > M-o< / kbd > | Insert an empty line and indent it properly (as in most IDEs).
2013-09-17 13:24:03 +03:00
< kbd > C-S-up< / kbd > or < kbd > M-S-up< / kbd > | Move the current line or region up.
< kbd > C-S-down< / kbd > or < kbd > M-S-down< / kbd > | Move the current line or region down.
2013-03-10 19:44:10 +02:00
< kbd > C-c n< / kbd > | Fix indentation in buffer and strip whitespace.
2013-03-31 14:31:40 +03:00
< kbd > C-c f< / kbd > | Open recently visited file.
< kbd > C-M-\\</ kbd > | Indent region (if selected) or the entire buffer.
2014-07-30 15:51:22 +03:00
< kbd > C-c u< / kbd > | Open a new buffer containing the contents of URL.
2013-03-10 19:44:10 +02:00
< kbd > C-c e< / kbd > | Eval a bit of Emacs Lisp code and replace it with its result.
< kbd > C-c s< / kbd > | Swap two active windows.
2014-05-27 07:19:01 +03:00
< kbd > C-c D< / kbd > | Delete current file and buffer.
2013-03-10 19:44:10 +02:00
< kbd > C-c d< / kbd > | Duplicate the current line (or region).
2013-07-13 14:15:16 +03:00
< kbd > C-c M-d< / kbd > | Duplicate and comment the current line (or region).
2014-05-31 20:11:42 +03:00
< kbd > C-c r< / kbd > | Rename the current buffer and its visiting file if any.
2013-03-10 19:44:10 +02:00
< kbd > C-c t< / kbd > | Open a terminal emulator (`ansi-term`).
< kbd > C-c k< / kbd > | Kill all open buffers except the one you're currently in.
2014-05-27 07:19:01 +03:00
< kbd > C-c TAB< / kbd > | Indent and copy region to clipboard
< kbd > C-c I< / kbd > | Open user's init file.
< kbd > C-c S< / kbd > | Open shell's init file.
< kbd > C-c . +< / kbd > | Increment integer at point. Default is +1.
< kbd > C-c . -< / kbd > | Decrement integer at point. Default is -1.
< kbd > C-c . *< / kbd > | Multiply integer at point. Default is *2.
< kbd > C-c . /< / kbd > | Divide integer at point. Default is /2.
2014-08-13 17:57:39 +03:00
< kbd > C-c . \\</ kbd > | Modulo integer at point. Default is modulo 2.
2014-05-27 07:19:01 +03:00
< kbd > C-c . ^< / kbd > | Power to the integer at point. Default is ^2.
< kbd > C-c . < < / kbd > | Left-shift integer at point. Default is 1 position to the left.
< kbd > C-c . >< / kbd > | Right-shift integer at point. Default is 1 position to the right.
< kbd > C-c . #< / kbd > | Convert integer at point to specified base. Default is 10.
< kbd > C-c . %< / kbd > | Replace integer at point with another specified integer.
< kbd > C-c . '< / kbd > | Perform arithmetic operations on integer at point. User specifies the operator.
2014-08-14 13:47:15 +03:00
< kbd > Super-g< / kbd > | Toggle between God mode and non-God mode
2013-07-23 15:18:50 +03:00
< kbd > Super-r< / kbd > | Recent files
< kbd > Super-j< / kbd > | Join lines
< kbd > Super-k< / kbd > | Kill whole line
2013-10-03 20:54:12 +03:00
< kbd > Super-m m< / kbd > | Magit status
< kbd > Super-m l< / kbd > | Magit log
< kbd > Super-m f< / kbd > | Magit file log
< kbd > Super-m b< / kbd > | Magit blame mode
2012-12-08 15:23:33 +02:00
2014-05-27 07:19:01 +03:00
**Note**: For various arithmetic operations, the prefix `C-c .` only needs to be pressed once for the first operation.
For subsequent operations, only the appropriate operations (i.e. `+` , `-` , `*` , `/` ... needs to be pressed).
2013-09-02 11:57:38 +03:00
#### OSX modifier keys
Prelude does not mess by default with the standard mapping of `Command` (to `Super` ) and `Option` (to `Meta` ).
If you want to swap them add this to your personal config:
```lisp
(setq mac-command-modifier 'meta)
(setq mac-option-modifier 'super)
```
You can also temporarily swap them with `C-c w` (`M-x prelude-swap-meta-and-super`).
2012-12-08 15:23:33 +02:00
#### Projectile
2013-03-31 14:31:40 +03:00
Here's a list of functionality provided by [Projectile ](https://github.com/bbatsov/projectile ):
2013-03-10 19:44:10 +02:00
Keybinding | Description
-------------------|------------------------------------------------------------
< 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.
2013-06-30 16:11:00 +03:00
< 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.
2013-03-10 19:44:10 +02:00
< kbd > C-c p T< / kbd > | Display a list of all test files(specs, features, etc) in the project.
2014-08-23 18:59:50 +03:00
< kbd > C-c p s g< / kbd > | Run grep on the files in the project.
< kbd > M-- C-c p s g</ kbd > | Run grep on `projectile-grep-default-files` in the project.
2013-03-10 19:44:10 +02:00
< kbd > C-c p b< / kbd > | Display a list of all project buffers currently open.
< kbd > C-c p o</ kbd > | Runs `multi-occur` on all project buffers currently open.
< kbd > C-c p r< / kbd > | Runs interactive query-replace on all files in the projects.
< kbd > C-c p i< / kbd > | Invalidates the project cache (if existing).
< kbd > C-c p R</ kbd > | Regenerates the projects `TAGS` file.
< kbd > C-c p k< / kbd > | Kills all project buffers.
2013-06-30 16:11:00 +03:00
< kbd > C-c p D</ kbd > | Opens the root of the project in `dired` .
2013-03-10 19:44:10 +02:00
< kbd > C-c p e< / kbd > | Shows a list of recently visited project files.
2014-08-23 18:59:50 +03:00
< kbd > C-c p s a</ kbd > | Runs `ack` on the project. Requires the presence of `ack-and-a-half` .
< kbd > C-c p s s</ kbd > | Runs `ag` on the project. Requires the presence of `ag.el` .
2015-11-02 15:09:20 +02:00
< kbd > C-c p a< / kbd > | Switch between files with the same name but different extensions.
2013-06-30 16:11:00 +03:00
< kbd > C-c p c< / kbd > | Runs a standard compilation command for your type of project.
2014-09-24 10:11:11 +03:00
< kbd > C-c p P< / kbd > | Runs a standard test command for your type of project.
2013-03-10 19:44:10 +02:00
< kbd > C-c p z< / kbd > | Adds the currently visited to the cache.
2014-08-23 18:59:50 +03:00
< kbd > C-c p p< / kbd > | Display a list of known projects you can switch to.
2013-03-10 19:44:10 +02:00
2014-07-15 17:38:59 +03:00
Prelude adds an extra keymap prefix `S-p` (`S` stands for
2014-07-15 17:37:07 +03:00
`Super` ), so you can use `S-p` instead of `C-c p` .
2013-07-23 15:18:50 +03:00
2013-03-10 19:44:10 +02:00
If you ever forget any of Projectile's keybindings just do a:
< kbd > C-c p C-h< / kbd >
2012-12-08 15:23:33 +02:00
2014-08-30 10:03:31 +03:00
#### Helm
Helm is setup according to this guide: [A Package in a league of its own: Helm ](http://tuhdo.github.io/helm-intro.html ).
2014-08-30 19:56:06 +03:00
You can learn Helm usage and key bindings following the guide. < kbd > C-c h< / kbd > is Prelude's default prefix key for Helm.
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.
2014-08-31 23:09:10 +03:00
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)` .
When `prelude-helm-everywhere` is activated, Helm enables these global key bindings:
2014-08-30 19:56:06 +03:00
Key binding | Description
-------------------|----------------------------------------------
< 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 > .
< kbd > M-y</ kbd > | Run [helm-show-kill-ring ](http://tuhdo.github.io/helm-intro.html#sec-4 ), shows the content of `kill-ring` .
< 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.
< 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.
2014-08-31 23:09:10 +03:00
< kbd > C-h f </ kbd > | Run [helm-apropos ](http://tuhdo.github.io/helm-intro.html#sec-13 ), an interactive version of `apropos-command` .
2014-08-30 19:56:06 +03:00
< 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` .
< kbd > C-h C-l </ kbd > | Run `helm-locate-library` that can search for locations of any file loaded into Emacs.
2014-08-31 23:09:10 +03:00
This key binding is activated in `shell-mode` :
2014-08-30 19:56:06 +03:00
Key Binding | Description
-------------------|----------------------------------------------
2014-08-31 23:09:10 +03:00
< kbd > C-c C-l</ kbd > | Run `helm-comint-input-ring` that shows `shell` history using Helm interface.
2014-08-30 19:56:06 +03:00
2014-08-31 23:09:10 +03:00
This key bindings is activated in `eshell-mode` :
2014-08-30 19:56:06 +03:00
Key Binding | Description
-------------------|----------------------------------------------
2014-08-31 23:09:10 +03:00
< kbd > C-c C-l</ kbd > | Run `helm-eshell-history` that shows `eshell` history using Helm interface.
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.
You can always reactivate Helm with `(prelude-global-helm-global-mode-on)` .
2014-08-30 19:56:06 +03:00
2014-12-17 05:18:54 +02:00
**NOTICE**: In `helm-M-x` , you have to pass prefix argument *AFTER* you run `helm-M-x` ,
because your prefix argument will be displayed in the modeline when in `helm-M-x`
buffer. Passing prefix argument **BEFORE** =helm-M-x= **has no effect** .
2014-08-30 10:03:31 +03:00
2013-05-03 18:04:57 +03:00
#### Key-chords
2013-11-03 23:50:09 +02:00
**Key-chords are available only when the `prelude-key-chord` module has been enabled.**
2013-05-03 18:04:57 +03:00
Keybinding | Description
-------------------|----------------------------------------------
2015-05-09 13:02:43 +03:00
< kbd > jj< / kbd > | Jump to the beginning of a word(`avy-goto-word-1`)
< kbd > jk< / kbd > | Jump to a character(`avy-goto-char`)
< kbd > jl< / kbd > | Jump to the beginning of a line(`avy-goto-line`)
2016-05-03 06:14:31 +03:00
< kbd > JJ< / kbd > | Jump back to previous buffer(`crux-switch-to-previous-buffer`)
2013-05-04 12:26:35 +03:00
< kbd > uu< / kbd > | View edits as a tree(`undo-tree-visualize`)
2013-12-13 16:07:02 +02:00
< kbd > xx< / kbd > | Executed extended command(`execute-extended-command`)
< kbd > yy< / kbd > | Browse the kill ring(`browse-kill-ring`)
2013-05-03 18:04:57 +03:00
2013-05-22 17:22:15 +03:00
##### Disabling key-chords
In some cases you may not want to have a key-chord that is defined by prelude,
in which case you can disable the binding in your `personal.el` file by setting
2013-05-30 14:27:35 +03:00
its command to `nil` . For example, to disable the `jj` key-chord add the
2013-05-22 17:22:15 +03:00
following line:
2013-05-30 00:03:39 +03:00
```lisp
(key-chord-define-global "jj" nil)
```
2013-05-23 11:10:55 +03:00
If you're an `evil-mode` user you'll probably do well to disable `key-chord-mode` altogether:
2013-05-30 00:03:39 +03:00
```lisp
(key-chord-mode -1)
```
2013-05-22 17:22:15 +03:00
2014-04-25 22:49:22 +03:00
#### vim emulation
If you want to use vim inside of emacs enable the `prelude-evil` module which provides
support for `evil-mode` .
2013-05-22 17:22:15 +03:00
## Automatic package installation
2012-09-16 13:16:37 +03:00
The default Prelude installation comes with a bare minimum of
functionality. It will however install add-ons for various programming
languages and frameworks on demand. For instance - if you try to open
2013-11-03 23:55:11 +02:00
a `.clj` file `clojure-mode` , `cider` and Prelude's enhanced Lisp
2012-09-16 13:16:37 +03:00
configuration will be installed automatically for you.
You can, of course, install anything you wish manually as well.
2012-09-16 14:52:48 +03:00
### Color Themes
2012-09-05 13:41:54 +03:00
2016-10-03 08:58:09 +03:00
Emacs provides a dozen of
2012-09-05 13:41:54 +03:00
built-in themes you can use out-of-the-box by invoking the `M-x
load-theme` command.
2016-10-03 08:58:09 +03:00
[Zenburn ](https://github.com/bbatsov/zenburn-emacs ) is the default
color theme in Prelude, but you can change it at your discretion. Why
Zenburn? I (and lots of hackers around the world) find it pretty neat
for some reason. Personally I find the default theme pretty tiresome
for the eyes, that's why I took that "controversial" decision to
replace it. You can, of course, easily go back to the default (or
select another theme entirely).
2012-09-05 13:41:54 +03:00
To disable Zenburn just put in your personal config the following
line:
2012-09-16 13:16:37 +03:00
```lisp
2012-09-05 13:41:54 +03:00
(disable-theme 'zenburn)
```
2014-10-11 06:56:40 +03:00
Or you can use another theme altogether by adding something in `personal/preload` like:
2012-09-05 13:41:54 +03:00
2012-09-16 13:16:37 +03:00
```lisp
2014-10-11 06:56:40 +03:00
(setq prelude-theme 'solarized-dark)
2012-09-05 13:41:54 +03:00
```
2013-07-27 18:07:32 +03:00
**P.S.** Solarized is not available by default - you'll have to
install it from MELPA first (`M-x package-install RET
solarized-theme`).
2012-09-05 13:41:54 +03:00
2015-05-16 00:53:39 +03:00
Finally, if you don't want any theme at all, you can add this to your
`personal/preload` :
```lisp
(setq prelude-theme nil)
```
2012-09-16 14:52:48 +03:00
### Personalizing
2012-09-05 13:41:54 +03:00
Fork the official Prelude repo and add your own touch to it. You're advised to avoid changing stuff outside of the
personal folder to avoid having to deal with git merge conflicts in the future.
2013-03-10 19:47:24 +02:00
If you'd like to add some auto installation of packages in your
personal config use the following code:
```lisp
2013-07-23 15:53:17 +03:00
(prelude-require-packages '(some-package some-other-package))
```
If you require just a single package you can also use:
```lisp
(prelude-require-package 'some-package)
2013-03-10 19:47:24 +02:00
```
2013-12-06 17:34:06 +02:00
#### Preloading personal config
Sometimes you might want to load code before Prelude has started loading. Prelude will automatically preload all
Emacs Lisp files in your `personal/preload` directory. Note that at this point you can't using anything from
Prelude, except a few variables like `prelude-dir` , etc (since nothing is yet loaded).
2012-12-23 11:24:55 +02:00
#### Disabling whitespace-mode
2012-09-16 14:52:48 +03:00
2012-12-23 11:24:55 +02:00
Although `whitespace-mode` is awesome some people might find it too
intrusive. You can disable it in your
2012-12-09 00:49:35 +02:00
personal config with the following bit of code:
2012-09-16 14:52:48 +03:00
```lisp
2012-12-23 11:24:55 +02:00
(setq prelude-whitespace nil)
2012-09-16 14:52:48 +03:00
```
2013-03-27 19:29:52 +02:00
If you like `whitespace-mode` but prefer it to not automatically
cleanup your file on save, you can disable that behavior by setting
prelude-clean-whitespace-on-save to nil in your config file with:
```lisp
(setq prelude-clean-whitespace-on-save nil)
```
The prelude-clean-whitespace-on-save setting can also be set on a
per-file or directory basis by using a file variable or a
.dir-locals.el file.
2012-09-16 14:52:48 +03:00
#### Disable flyspell-mode
If you're not fond of spellchecking on the fly:
```lisp
2012-12-09 01:01:16 +02:00
(setq prelude-flyspell nil)
2012-09-16 14:52:48 +03:00
```
## Caveats & Pitfalls
2012-09-05 13:41:54 +03:00
2013-09-26 12:35:51 +03:00
### Updating bundled packages
Generally it's a good idea to do a package update before running
2013-10-22 15:37:05 +03:00
updating Prelude, since the latest Prelude code might depend on newer
2013-09-26 12:35:51 +03:00
versions of the bundled packages than you would currently have
installed.
2013-10-22 15:37:05 +03:00
If you're doing manual Prelude updates you should always do a package update first.
`M-x package-list-packages RET U x`
That's not necessary if you're using `M-x prelude-update` , since it
will automatically update the installed packages.
2012-09-16 14:52:48 +03:00
### Problems with flyspell-mode
2012-09-05 13:41:54 +03:00
Prelude makes heavy use of the flyspell-mode package for spell
checking of various things. The proper operation of flyspell depends
on the presence of the `aspell` program and an `en` dictionary on your
system. You can install `aspell` and the dictionary on OS X with
`homebrew` like this:
```bash
2013-06-01 20:57:39 +03:00
brew install aspell --with-lang=en
2012-09-05 13:41:54 +03:00
```
On Linux distros - just use your distro's package manager.
2012-09-16 14:52:48 +03:00
### Ugly colors in the terminal Emacs version
2012-09-05 13:41:54 +03:00
If your Emacs looks considerably uglier in a terminal (compared to the
GUI version) try adding this to your `.bashrc` or `.zshrc` :
```bash
2013-06-01 20:57:39 +03:00
export TERM=xterm-256color
2012-09-05 13:41:54 +03:00
```
Source the `.bashrc` file and start Emacs again.
2012-09-16 14:52:48 +03:00
### MELPA error on initial startup
2012-09-05 13:41:54 +03:00
If you get some http connection error related to the MELPA repo
just do a manual `M-x package-refresh-contents` and restart Emacs
2013-01-07 14:48:14 +02:00
afterwards.
2012-09-05 13:41:54 +03:00
2014-09-14 08:57:02 +03:00
### Warnings on arrow navigation in editor buffers
2012-09-05 13:41:54 +03:00
This is not a bug - it's a feature! I firmly believe that the one true
way to use Emacs is by using it the way it was intended to be used (as
2014-09-24 10:11:11 +03:00
far as navigation is concerned at least).
2012-09-05 13:41:54 +03:00
2014-09-14 08:57:02 +03:00
If you'd like to be take this a step further and disable the arrow key navigation
completely put this in your personal config:
2014-01-05 00:29:07 +02:00
```lisp
2014-09-14 08:57:02 +03:00
(setq guru-warn-only nil)
2014-01-05 00:29:07 +02:00
```
To disable `guru-mode` completely add the following snippet to your
personal Emacs config:
2012-09-16 13:16:37 +03:00
```lisp
2012-12-09 00:49:35 +02:00
(setq prelude-guru nil)
2012-09-16 13:16:37 +03:00
```
2013-05-23 11:27:01 +03:00
### Customized C-a behavior
Prelude overrides `C-a` to behave as described
[here ](http://emacsredux.com/blog/2013/05/22/smarter-navigation-to-the-beginning-of-a-line/ ). If
you don't like that simply add this to your personal config:
```lisp
(global-set-key [remap move-beginning-of-line]
'move-beginning-of-line)
```
2013-07-13 10:01:19 +03:00
### Poor ido matching performance on large datasets
Prelude swaps the default `ido` flex matching with the more powerful
2013-07-16 15:24:53 +03:00
[ido-flx ](https://github.com/lewang/flx ).
The sorting algorithm `flx` uses is more complex, but yields better results.
2015-01-06 22:19:52 +02:00
On slower machines, it may be necessary to lower `flx-ido-threshold` to
2013-07-16 15:24:53 +03:00
ensure a smooth experience.
```lisp
2015-01-06 22:19:52 +02:00
(setq flx-ido-threshold 1000)
2013-07-16 15:24:53 +03:00
```
You can always disable the improved sorting algorithm all together like this:
2013-07-13 10:01:19 +03:00
```lisp
(flx-ido-mode -1)
```
2012-09-16 14:52:48 +03:00
### Windows compatibility
2012-09-05 13:41:54 +03:00
While everything in Prelude should work fine in Windows, I test it only
2016-10-03 08:58:09 +03:00
with Linux & OS X, so there are Windows related problems from time to
2012-09-05 13:41:54 +03:00
time. This situation will probably improve over time.
2012-09-16 14:52:48 +03:00
## Known issues
2011-10-08 00:55:49 +03:00
2012-02-27 12:20:54 +02:00
Check out the project's
2012-04-17 20:23:53 +03:00
[issue list ](https://github.com/bbatsov/prelude/issues?sort=created&direction=desc&state=open )
2012-02-27 12:20:54 +02:00
a list of unresolved issues. By the way - feel free to fix any of them
2012-09-16 13:16:37 +03:00
and send me a pull request. :-)
2012-02-17 15:07:54 +02:00
2012-09-26 14:07:32 +03:00
## Support
Support is available via the Prelude Google Group < emacs-prelude @ googlegroups . com > .
2014-05-10 14:59:44 +03:00
There's also a Freenode channel you can visit - `#prelude-emacs` .
2012-09-16 14:52:48 +03:00
## Contributors
2012-02-17 15:07:54 +02:00
2012-04-17 20:23:53 +03:00
Here's a [list ](https://github.com/bbatsov/prelude/contributors ) of all the people who have contributed to the
2012-02-17 15:07:54 +02:00
development of Emacs Prelude.
2011-10-08 00:55:49 +03:00
2012-09-16 14:52:48 +03:00
## Bugs & Improvements
2011-10-11 21:09:02 +03:00
Bug reports and suggestions for improvements are always
2012-09-16 13:16:37 +03:00
welcome. GitHub pull requests are even better! :-)
2011-10-08 00:55:49 +03:00
2012-09-16 13:16:37 +03:00
Cheers,< br / >
2013-02-27 18:54:17 +02:00
[Bozhidar ](https://twitter.com/bbatsov )
2014-05-26 19:06:52 +03:00
[badge-license]: https://img.shields.io/badge/license-GPL_3-green.svg