5

Clojure を Emacs で探索するための標準的な環境をまとめたいと考えています。これに合うレシピを持っている人はいますか?NREPLといくつかの便利なEMACSサポートプラグインを備えた、Ubuntuのフレーバーを実行するVagrantシステムを考えています。

4

2 に答える 2

11
vagrant box add preciseMinimal http://goo.gl/wxdwM

Clojure vagrant ベース フォルダーに変更

vagrant init preciseMinimal
vagrant up

vagrant ssh

または 127.0.0.1 ポート 2222 (または「vagrant up」出力に記載されている他のポート) に ssh します。

sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:cassou/emacs
sudo apt-get update
sudo apt-get install emacs24 emacs24-el emacs24-common-non-dfsg
sudo apt-get install clojure

cd ~/
mkdir bin

sed '$ a\
export PATH=~/bin:$PATH' ~/.bashrc

終了してsshに再接続します

cd ~/bin
wget https://raw.github.com/technomancy/leiningen/preview/bin/lein
chmod +x lein
./lein


cd ~
cat >.emacs
; Package.el customization
(package-initialize)
(add-to-list 'package-archives
             '("melpa" . "http://melpa.milkbox.net/packages/") t)

;; install packages
(defvar my-packages '(
  auto-complete
  clojure-mode
  clojure-test-mode
  nrepl
  ac-nrepl
  paredit
  rainbow-delimiters
))

(dolist (p my-packages)
  (when (not (package-installed-p p))
  (package-refresh-contents)
    (package-install p)))
;; The following line can be removed after first install to speed up startup
(byte-recompile-directory (expand-file-name "~/.emacs.d") 0)

(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.
 '(auto-save-default nil)
 '(backup-inhibited t t)
 '(cursor-type 'bar t)
 '(column-number-mode t)
 '(delete-selection-mode t)
 '(inhibit-startup-screen t)
 '(initial-scratch-message nil)
 '(tool-bar-mode nil)
 '(xterm-mouse-mode 1))

;; rainbow delimiters
(require '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)

;; clojure-mode
(global-set-key [f9] 'nrepl-jack-in)

;; 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)

;; Auto complete
(require 'auto-complete-config)
(ac-config-default)
(define-key ac-completing-map "\M-/" 'ac-stop)

;; 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))
#CTRL-D to finish

感謝の気持ちを込めて: http://blog.worldcognition.com/2012/07/setting-up-emacs-for-clojure-programming.html

于 2013-06-01T11:32:16.803 に答える
4

Github でホストされ、シェルでプロビジョニングされた vagrant セットアップは次の場所にあります。

https://github.com/pattinsont/Ukelele

必要なのは、チェックアウトと vagrant up だけです。

VM が起動したら、ボックスに ssh します。emacs を実行してインストールを完了します。その後、Mxサイダージャックイン

于 2013-06-02T18:40:33.417 に答える