Skip to content

Commit

Permalink
Restructure the README into a manual
Browse files Browse the repository at this point in the history
  • Loading branch information
bbatsov authored and Caleb Epstein committed Sep 4, 2019
1 parent 771991b commit 08870ce
Show file tree
Hide file tree
Showing 17 changed files with 789 additions and 683 deletions.
668 changes: 0 additions & 668 deletions README.md

Large diffs are not rendered by default.

File renamed without changes
125 changes: 125 additions & 0 deletions doc/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Configuration

## Color Themes

Emacs provides a dozen of
built-in themes you can use out-of-the-box by invoking the `M-x
load-theme` command.

[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).

To disable Zenburn just put in your personal config the following
line:

```lisp
(disable-theme 'zenburn)
```

Or you can use another theme altogether by adding something in `personal/preload` like:

```lisp
(setq prelude-theme 'tango)
```

**Note** To use a non-built-in theme, like [Solarized](https://github.com/bbatsov/zenburn-emacs),
you'll have to install it from MELPA first by `M-x package-install RET solarized-theme`. Then add

``` lisp
(setq prelude-theme 'solarized-dark)
```
in `personal/preload`.

Finally, if you don't want any theme at all, you can add this to your
`personal/preload`:

```lisp
(setq prelude-theme nil)
```

## Personalizing

All files you create under the `personal/` directory are yours for
personalization. There is no single special personal config file --
any files you create in the `personal/` directory will be loaded in
lexicographical order. The overall loading precedence is:

1. `personal/preload/*`
2. `core/`
3. `prelude-modules.el`
4. `personal/*`

#### Personalization Example

Suppose you want to configure `go-mode` to autoformat on each save. You
can create a file in `personal/`, let's call this one
`config-go-mode.el` and add the following to it.

``` emacs-lisp
(add-hook 'go-mode-hook
(lambda ()
(add-hook 'before-save-hook 'gofmt-before-save)
(setq tab-width 2)))
```

#### Tips

**Fork** (instead of cloning) 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.

If you'd like to add some auto installation of packages in your
personal config use the following code:

```lisp
(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)
```

### 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).

### Disabling whitespace-mode

Although `whitespace-mode` is awesome, some people might find it too
intrusive. You can disable it in your
personal config with the following bit of code:

```lisp
(setq prelude-whitespace nil)
```

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.


### Disable flyspell-mode

If you're not fond of spellchecking on the fly:

```lisp
(setq prelude-flyspell nil)
```
58 changes: 58 additions & 0 deletions doc/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
## Issues

Report issues and suggest features and improvements on the
[GitHub issue tracker](https://github.com/bbatsov/prelude/issues). Don't ask
questions on the issue tracker - use the [support channels](support.md) instead.

If you want to file a bug, please provide all the necessary info listed in
our issue reporting template (it's loaded automatically when you create a
new GitHub issue).

## Patches

Patches in any form are always welcome! GitHub pull requests are even better! :-)

Before submitting a patch or a pull request make sure that your patch
is in line with the [contribution
guidelines](https://github.com/bbatsov/prelude/blob/master/CONTRIBUTING.md).

## Documentation

Good documentation is just as important as good code.

Consider improving and extending the
this manual and the
[community wiki](https://github.com/bbatsov/prelude/wiki).

### Working on the Manual

The manual is generated from the markdown files in the
[doc](https://github.com/bbatsov/prelude/tree/master/doc) folder of Prelude's
GitHub repo and is published to [Read the Docs](readthedocs.org). The
[MkDocs](http://www.mkdocs.org/) tool is used to convert the markdown sources to
HTML.

To make changes to the manual you simply have to change the files under
`doc`. The manual will be regenerated automatically when changes to those files
are merged in `master` (or the latest stable branch).

You can install `MkDocs` locally and use the command `mkdocs serve` to see the
result of changes you make to the manual locally:

```sh
$ cd path/to/prelude/repo
$ mkdocs serve
```

If you want to make changes to the manual's page structure you'll have to edit
[mkdocs.yml](https://github.com/bbatsov/prelude/blob/master/mkdocs.yml).

## Donations

You can support the development of Prelude via
[Salt](https://salt.bountysource.com/teams/prelude),
[Patreon](https://www.patreon.com/bbatsov) and
[Liberapay](https://liberapay.com/bbatsov/donate).

[![Liberapay](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/bbatsov/donate)
[![Patreon](https://img.shields.io/badge/patreon-donate-orange.svg)](https://www.patreon.com/bbatsov)
15 changes: 15 additions & 0 deletions doc/css/extra.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* By default kbd doesn't stand out very much. Let's fix this! */
kbd {
padding: 3px 5px;
border: solid 1px #ccc;
background-color: #fcfcfc;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #bbb;
display: inline-block;
}

/* The default font-size for code blocks is 75% which makes code
hard to read. */
code {
font-size: 90%;
}
3 changes: 3 additions & 0 deletions doc/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Frequently Asked Questions

Coming soon...
18 changes: 18 additions & 0 deletions doc/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Emacs Prelude

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.

Prelude is compatible **ONLY with GNU Emacs 25.1+**. In general you're
advised to always run Prelude with the latest Emacs - currently
**26.1**.

You can support the development of Prelude via
[PayPal](https://www.paypal.me/bbatsov),
[Salt](https://bountysource.com/teams/prelude),
[Patreon](https://www.patreon.com/bbatsov) and
[Liberapay](https://liberapay.com/bbatsov/donate).
122 changes: 122 additions & 0 deletions doc/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# Installation

## Installing Emacs

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).

## Installation

### Automated

You can install **Emacs Prelude** via the command line with either `curl` or
`wget`. Naturally `git` is also required.

#### Via Curl

If you're using `curl` type the following command:

```bash
curl -L https://github.com/bbatsov/prelude/raw/master/utils/installer.sh | sh
```

#### Via Wget

If you're using `wget` type:

```bash
wget --no-check-certificate https://github.com/bbatsov/prelude/raw/master/utils/installer.sh -O - | sh
```

### Manual

Make sure you do not have any `~/.emacs` file present.

```bash
git clone git://github.com/bbatsov/prelude.git path/to/local/repo
ln -s path/to/local/repo ~/.emacs.d
cd ~/.emacs.d
```

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.

## Updating Prelude

### Manual update

The update procedure is fairly straightforward and consists of 3 steps:

#### Update all bundled packages

Just run <kbd>M-x package-list-packages RET U x</kbd>.

#### Update Prelude's code

```bash
cd path/to/prelude/installation
git pull
```

The `path/to/prelude/installation` is usually `~/.emacs.d` (at least
on Unix systems).

#### Restart Prelude

It's generally a good idea to stop Emacs after you do the update. The
next time Prelude starts it will install any new dependencies (if
there are such).

### Automatic update

Simply run <kbd>M-x prelude-update</kbd> from Emacs itself and restart Emacs afterwards.

## 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.

## Enabling additional modules

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/index.md).

```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)
;; (require 'prelude-elixir)
;; (require 'prelude-haskell)
(require 'prelude-js)
;; (require 'prelude-latex)
(require 'prelude-lisp)
(require 'prelude-org)
(require 'prelude-perl)
;; (require 'prelude-python)
;; (require 'prelude-ruby)
;; (require 'prelude-scala)
(require 'prelude-scheme)
;; (require 'prelude-scss)
;; (require 'prelude-web)
(require 'prelude-xml)
```

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.

After you've uncommented a module you should either restart Emacs or evaluate the module
`require` expression with <kbd>C-x C-e</kbd>.
22 changes: 11 additions & 11 deletions modules/doc/prelude-erc.md → doc/modules/erc.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Prelude ERC Quickstart
# Prelude ERC

## Customizing Server list

If you want to join a list of servers on `M-x start-irc`, other than
the default list, please redefine the variable `my-fav-irc` as follows
in your personal config

``` emacs-lisp
(setq my-fav-irc '("irc.freenode.net"
``` emacs-lisp
(setq my-fav-irc '("irc.freenode.net"
"irc.oftc.net"
"irc.mozilla.org"
"irc.gnome.org"))
"irc.mozilla.org"
"irc.gnome.org"))
```

## Customizing Last Quit Message
Expand All @@ -19,17 +19,17 @@ If you want to customize your IRC Last Quit Message from *Asta la
vista* to something more funkier, please redefine `bye-irc-message` as
follows

``` emacs-lisp
(setq bye-erc-message "adios")
``` emacs-lisp
(setq bye-erc-message "adios")
```

## Reading NickServ passwords from auth-source plugin

If you want to automatically authenticate while logging into IRC
servers set the `erc-prompt-for-password` to nil as follows

``` emacs-lisp
(setq erc-prompt-for-password nil)
``` emacs-lisp
(setq erc-prompt-for-password nil)
```

Now you can set password in plaintext in .authinfo file in the netRC
Expand All @@ -45,6 +45,6 @@ to group all the ERC buffers into one perspective called `IRC` when
`start-irc` is called. To enable this set the `prelude-new-irc-persp`
variable to true as follows

``` emacs-lisp
(setq prelude-new-irc-persp t)
``` emacs-lisp
(setq prelude-new-irc-persp t)
```
Loading

0 comments on commit 08870ce

Please sign in to comment.