准备家伙
$ cd ~/.emacs.d/
$ wget http://yasnippet.googlecode.com/files/yasnippet-0.6.1c.tar.bz2
$ tar -xjvf yasnippet-0.6.1c.tar.bz2
$ ln -s yasnippet-0.6.1c yasnippet
$ cp -r $SCALA_HOME/misc/scala-tool-support/emacs ~/.emacs.d/scala-mode
$ wget https://github.com/downloads/aemoncannon/ensime/ensime_2.8.1-0.4.2.tar.gz
$ tar -zxvf ensime_2.8.1-0.4.2.tar.gz
$ ln -s ensime_2.8.1-0.4.2 ensime
配置.emacs
$ emacs .emacs
;;;;添加如下代码:
;; yasnippet
(add-to-list 'load-path
"~/.emacs.d/yasnippet")
(require 'yasnippet) ;; not yasnippet-bundle
(yas/initialize)
(yas/load-directory "~/.emacs.d/yasnippet/snippets")
;; scala-mode
(add-to-list 'load-path "~/.emacs.d/scala-mode")
(require 'scala-mode-auto) ;; 编辑.scala文件时自动启动scala mode
;; scala yasnippet
(setq yas/my-directory "~/.emacs.d/scala-mode/contrib/yasnippet/snippets")
(yas/load-directory yas/my-directory)
(add-hook 'scala-mode-hook
'(lambda ()
(yas/minor-mode-on)
))
;; scala-ensime
(add-to-list 'load-path "~/.emacs.d/ensime/elisp")
(require 'ensime)
(add-hook 'scala-mode-hook 'ensime-scala-mode-hook) ;; scala mode下自动启动ensime
还不错。现在才知道SCALA_HOME是要设置在libexec目录的。######
可能因为版本的问题
;; scala yasnippet
(setq yas/my-directory "~/.emacs.d/scala-mode/contrib/yasnippet/snippets")
(yas/load-directory yas/my-directory)
(add-hook 'scala-mode-hook
'(lambda ()
(yas/minor-mode-on)
))
已经不用设置了
=================================================版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。