Skip to content

Instantly share code, notes, and snippets.

@MiyamotoAkira
Last active Jun 27, 2018
Embed
What would you like to do?
Emacs Basics Workshop
(setq custom-file "~/.emacs.d/custom.el")
(require 'package)
(setq package-archives
(quote
(("elpa" . "https://elpa.gnu.org/packages/")
("melpa-stable" . "https://stable.melpa.org/packages/")
("melpa" . "https://melpa.org/packages/"))))
(package-initialize)
(unless package-archive-contents
(package-refresh-contents))
(unless (package-installed-p 'use-package)
(package-install 'use-package))
(use-package exec-path-from-shell
:ensure t)
(exec-path-from-shell-initialize)
(use-package company
:ensure t
:config
(add-hook 'after-init-hook 'global-company-mode))
(defun clj-clojure-hook ()
(clj-refactor-mode 1)
(yas-minor-mode 1)
(cljr-add-keybindings-with-prefix "C-c C-m"))
(use-package cider
:defer t
:ensure t
:pin melpa-stable
:config
(add-hook 'cider-repl-mode-hook 'paredit-mode)
(add-hook 'cider-mode-hook 'paredit-mode)
(add-hook 'cider-mode-hook #'eldoc-mode)
(add-hook 'cider-mode-hook #'company-mode)
(add-hook 'cider-repl-mode-hook #'company-mode))
(use-package clojure-mode
:defer t
:ensure t
:pin melpa-stable
:config
(add-hook 'clojure-mode-hook 'subword-mode)
(add-hook 'clojure-mode-hook #'aggressive-indent-mode)
(add-hook 'clojure-mode-hook
(lambda ()
(setq inferior-lisp-program "lein repl")
(font-lock-add-keywords
nil
'(("(\\(facts?\\)"
(1 font-lock-keyword-face))
("(\\(background?\\)"
(1 font-lock-keyword-face))))
(define-clojure-indent (fact 1))
(define-clojure-indent (facts 1))))
(add-hook 'clojure-mode-hook #'cider-mode))
(use-package clj-refactor
:defer t
:ensure t
:pin melpa-stable
:config
(add-hook 'clojure-mode-hook #'clj-clojure-hook))
(use-package clojure-mode-extra-font-locking
:defer t
:ensure t
:pin melpa-stable)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment