Create a gist now

Instantly share code, notes, and snippets.

@mkamotsu /init.el
Last active Apr 25, 2017

What would you like to do?
Clojure環境の設定
;; 対応する括弧の強調表示
(show-paren-mode t)
;; Emacs24標準のパッケージマネージャ
;; 必要なパッケージをインストール
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
(when (not package-archive-contents)
(package-refresh-contents))
(dolist (p '(paredit
auto-complete
yasnippet
clojure-mode
cider
ac-nrepl
clojure-cheatsheet
clojure-snippets))
(when (not (package-installed-p p))
(package-install p)))
;; nrepl.el後継らしいのCIDER
(require 'cider)
;; ミニバッファに関数の引数を表示
(add-hook 'cider-mode-hook 'cider-turn-on-eldoc-mode)
;; auto-completeの設定
(require 'auto-complete-config)
(ac-config-default)
;; auto-completeのポップアップメニューでC-n/C-pが使えるようにする
(setq ac-use-menu-map t)
;; yasnippetの設定
(require 'yanippet)
(yas-global-mode 1)
;; ciderのreplでauto-completeが使えるようにする
(require 'ac-nrepl)
(add-hook 'cider-repl-mode-hook 'ac-nrepl-setup)
(add-hook 'cider-mode-hook 'ac-nrepl-setup)
(eval-after-load "auto-complete"
'(add-to-list 'ac-modes 'cider-repl-mode))
;; clojure用のyasnippet
(require 'clojure-snippets)
(clojure-snippets-initialize)
;; pareditの設定
(require 'paredit)
(dolist (hook '(cider-repl-mode-hook
clojure-mode-hook))
(add-hook hook 'paredit-mode))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment