Skip to content

Instantly share code, notes, and snippets.

@nez
Created May 2, 2013 03:08
Show Gist options
  • Save nez/5499916 to your computer and use it in GitHub Desktop.
Save nez/5499916 to your computer and use it in GitHub Desktop.
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(add-to-list 'package-archives
'("marmelade" . "http://marmalade-repo.org/packages/"))
(when (< emacs-major-version 24)
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize)
(defvar my-packages '(starter-kit
starter-kit-lisp
starter-kit-bindings
starter-kit-eshell
clojure-mode
clojure-test-mode
ac-nrepl
auto-complete
nrepl
paredit
popup
rainbow-delimiters
magit
exec-path-from-shell
elein
csv-nav
gh
gist))
(dolist (p my-packages)
(when (not (package-installed-p p))
(package-install p)))
; Tomado de http://blog.worldcognition.com/2012/07/setting-up-emacs-for-clojure-programming.html
;; rainbow delimiters
(global-rainbow-delimiters-mode)
;; paredit
;(add-hook 'clojure-mode-hook 'paredit-mode)
;(add-hook 'nrepl-mode-hook 'paredit-mode)
;(global-set-key [f7] 'paredit-mode)
;; nrepl
(add-hook 'nrepl-interaction-mode-hook 'nrepl-turn-on-eldoc-mode)
(setq nrepl-popup-stacktraces nil)
(add-to-list 'same-window-buffer-names "*nrepl*")
(add-hook 'nrepl-mode-hook 'paredit-mode)
(global-set-key [f9] 'nrepl-jack-in)
;; Auto complete
(require 'auto-complete-config)
(ac-config-default)
(define-key ac-completing-map "\M-/" 'ac-stop) ; use M-/ to stop completion
;; ac-nrepl
(require 'ac-nrepl)
(add-hook 'nrepl-mode-hook 'ac-nrepl-setup)
(add-hook 'nrepl-interaction-mode-hook 'ac-nrepl-setup)
(eval-after-load "auto-complete" '(add-to-list 'ac-modes 'nrepl-mode))
;; Naquadah theme and some bullshit auto boilerplate
(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.
'(delete-selection-mode t)
'(custom-safe-themes (quote ("6d9ebd7eb3696a05474356bc8a13834b2911dafad937badd00d5e5b2592ed8e1" default))))
(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.
)
(load-theme 'naquadah t)
;; Magit mode
(require 'magit)
;; Para mac
(when (memq window-system '(mac ns))
(exec-path-from-shell-initialize))
;; CSV mode auto on csv files
(add-to-list 'auto-mode-alist '("\\.csv$" . csv-nav-mode))
;; Elein
(require 'elein)
;; Key Bindings
(global-set-key (kbd "C-c C-d") 'kill-whole-line)
(global-set-key (kbd "C-x C-l") 'elein-run-cmd)
(defalias 'lein 'elein-run-cmd)
(defalias 'jar 'elein-jar)
(defalias 'uberjar 'elein-uberjar)
(defalias 'deps 'elein-deps)
(defalias 'test 'elein-test)
(defalias 'log 'magit-log)
(defalias 'status 'magit-status)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment