https://github.com/lilactown/.emacs.d
https://github.com/lilactown/.emacs.d
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/lilactown/.emacs.d
- Owner: lilactown
- Created: 2017-10-06T18:35:51.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-06T18:36:07.000Z (about 8 years ago)
- Last Synced: 2025-02-15T18:48:32.652Z (8 months ago)
- Language: Emacs Lisp
- Size: 1.78 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# this is a Clojure-friendly emacs config
If you're new to emacs, check out
[this introductory tutorial](http://www.braveclojure.com/basic-emacs/)!## WARNING
This project uses an outdated version of
[CIDER](https://github.com/clojure-emacs/cider), the package that
provides much of the functionality for Clojure development. If you run
into issues, try upgrading (instructions below).Why not just update this package to use the latest CIDER, you ask?
This project uses CIDER 0.8.1 so that
[Clojure for the Brave and True](http://www.braveclojure.com/basic-emacs/)
readers are less likely to get confused as they use Emacs for the
first time.## Installing
1. Close Emacs.
2. Delete `~/.emacs` or `~/.emacs.d` if they exist. (Windows users, your
emacs files will probably live in
`C:\Users\your_user_name\AppData\Roaming\`. So, for example, you
would delete `C:\Users\jason\AppData\Roaming\.emacs.d`.) This is
where Emacs looks for configuration files, and deleting these files
and directories will ensure that you start with a clean slate.
3. Download the Emacs
[configuration zip file](https://github.com/flyingmachine/emacs-for-clojure/archive/book1.zip)
and unzip it. Its contents should be a folder,
`emacs-for-clojure-book1`. Run `mv path/to/emacs-for-clojure-book1
~/.emacs.d`.
4. Create the file `~/.lein/profiles.clj` (Windows users, this is
probably `C:\Users\your_user_name\.lein\profiles.clj`) and add this
line to it:```clojure
{:user {:plugins [[cider/cider-nrepl "0.8.1"]]}}
```Then open Emacs.
## Upgrading
Before upgrading, ensure that your `.emacs.d` directory is under
version control so that you can always revert to a known good state.To upgrade:
1. Edit `.emacs.d/init.el`, adding these lines after line 12:
```elisp
(add-to-list 'package-archives
'("melpa-stable" . "http://stable.melpa.org/packages/") t)
(add-to-list 'package-pinned-packages '(cider . "melpa-stable") t)
```2. Close Emacs.
3. Run `rm -Rf .emacs.d/elpa/cider-*`
4. Open Emacs. You'll probably see some errors and your theme won't
load. That's ok.
5. In Emacs, run `M-x package-refresh contents`.
6. In Emacs, run `M-x package-install cider`.
7. Close and re-open Emacs.
8. Open `.lein/profiles.clj` and remove `[cider/cider-nrepl "0.8.1"]` from it.That should install the latest version. Enjoy!
## Organization
I've tried to separate everything logically and document the purpose
of every line. [`init.el`](./init.el) acts as a kind of table of
contents. It's a good idea to eventually go through `init.el` and the
files under the `customizations` directory so that you know exactly
what's going on.## Supporting CSS, HTML, JS, etc.
Emacs has decent support for CSS, HTML, JS, and many other file types out of the box, but if you want better support, then have a look at [my personal emacs config's init.el](https://github.com/flyingmachine/emacs.d/blob/master/init.el). It's meant to read as a table of contents. The emacs.d as a whole adds the following:
* [Customizes js-mode and html editing](https://github.com/flyingmachine/emacs.d/blob/master/customizations/setup-js.el)
* Sets indentation level to 2 spaces for JS
* enables subword-mode so that M-f and M-b break on capitalization changes
* Uses `tagedit` to give you paredit-like functionality when editing html
* adds support for coffee mode
* [Uses enh-ruby-mode for ruby editing](https://github.com/flyingmachine/emacs.d/blob/master/customizations/setup-ruby.el). enh-ruby-mode is a little nicer than the built-in ruby-mode, in my opinion.
* Associates many filenames and extensions with enh-ruby-mode (.rb, .rake, Rakefile, etc)
* Adds keybindings for running specs
* Adds support for YAML and SCSS using the yaml-mode and scss-mode packagesIn general, if you want to add support for a language then you should be able to find good instructions for it through Google. Most of the time, you'll just need to install the "x-lang-mode" package for it.