Skip to content

Instantly share code, notes, and snippets.

@timmc
Created May 19, 2011 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timmc/980934 to your computer and use it in GitHub Desktop.
Save timmc/980934 to your computer and use it in GitHub Desktop.
.emacs for Clojure
;;;; Provided by Alec
;; add el-get to the load-path
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
;; install it if we don't already have it
(require 'el-get)
;;(unless (require 'el-get "" t)
;; (message "Couldn't require el-get, installing it now...")
;; (let* ((installer-buffer (url-retrieve-synchronously
;; (concat "https://github.com/dimitri/"
;; "el-get/raw/master/el-get-install.el"))))
;; (save-excursion
;; (switch-to-buffer-other-window installer-buffer)
;; (end-of-buffer)
;; (eval-print-last-sexp)))
;; (message "Couldn't require el-get, installing it now...done"))
(setq el-get-sources
`(el-get package color-theme color-theme-twilight
highlight-parentheses paredit
; slime ; I'm not sure whether including slime explicitly is necessary
swank-clojure
clojure-mode))
(el-get 'sync)
;; ido- it makes things better
(ido-mode 1)
(ido-everywhere t)
(setq ido-enable-flex-matching t
ido-create-new-buffer 'always)
(global-set-key (kbd "C-x C-b") 'ibuffer)
;; parentheses
(dolist (hook '(scheme-mode-hook
lisp-mode-hook
emacs-lisp-mode-hook
clojure-mode-hook))
(add-hook hook (lambda ()
(paredit-mode t)
(highlight-parentheses-mode t))))
(setq parens-require-spaces nil)
(setq show-paren-style 'expression)
(show-paren-mode t)
(set-face-background 'show-paren-match "grey13")
(require 'eldoc)
(add-hook 'emacs-lisp-mode-hook 'eldoc-mode)
;;;; From http://www.brainonfire.net/blog/emacs-n00b-start/#comment-49937
(setq
backup-by-copying t ; don't clobber symlinks
backup-directory-alist
'(("." . "~/.emacs-backups")) ; don't litter my fs tree
delete-old-versions t
kept-new-versions 6
kept-old-versions 2
version-control t) ; use versioned backups
;;;; Own additions
(add-hook 'slime-repl-mode-hook 'clojure-mode-font-lock-setup)
(tool-bar-mode 1)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(column-number-mode t)
'(inhibit-startup-screen t)
'(initial-buffer-choice t)
'(show-paren-mode t))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(setq-default delete-selection-mode t)
(setq-default x-select-enable-clipboard t)
(setq-default indent-tabs-mode nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment