It's basic ~100 lines user friendly setup for Emacs beginners which provides comfortable Clojure development environment.
Plugins
- Clojure mode
- Paredit
- Parentheses Highlighting
- NREPL
- Auto Completion
- Lisp Indentation
- Textmate mode
- Tomorrow Theme
Off by deafult
- Line numbers
- Relative line numbers
- Vim-mode
- Whitespaces cleaning
Installation
- Download Emacs
- Emacs for MacOS
- Linux
- Windows
git clone git@github.com:edtsech/clojure-emacs-setup.git ~/.emacs.d
Usage
Emacs basics
C-x C-f- "find" file i.e. open/create a file in bufferC-x b- create/switch buffersC-x C-b- show buffer listC-x k- kill bufferC-x 2- split window horizontallyC-x 3- split window verticallyC-x 0- close current window(split)
Plugins
Paredit
C-<right>(def) a -> (def a)C-<left>(def a) -> (def) a
Auto completion
Just use tab key.
NREPL
M - is meta key, can be redefined, but usually its Alt key
C-c M-jorM-x nrepl-jack-in- connect to nREPLC-M-x- evaluate the top level formM-.- jump to the definition of a symbolM-,- return to your pre-jump location
Textmate mode
⌘t- go to file⌘l- go to line⌘/- comment line
Customize
Indentation
;; Set Compojure indentation ;; (put <macro|function> 'clojure-backtracking-indent '(<indent-first-arg> <indent-second-arg> ...) (put 'GET 'clojure-backtracking-indent '(2 2 2)) (put 'POST 'clojure-backtracking-indent '(2 2 2)) (put 'PUT 'clojure-backtracking-indent '(2 2 2)) (put 'DELETE 'clojure-backtracking-indent '(2 2 2)) (put 'PATCH 'clojure-backtracking-indent '(2 2 2))
Improvements
If you have some ideas how to improve the setup, I'm happy to participate. And if you need some help or you have a problem ping me on twitter(@edtsech) or send me an email.
Setups for other editors
- SublimeText
- Vim ???
