erlang用什么开发工具?看看erlang官方带了什么扩展?emacs !

(里面出现的插件名字,自己搜索,还有路径用自己路径)
上图先。 dp的emacs 哈~
 

 

配置 Erlang mode + distel:

 
  
  1. ;; Erlang mode 
  2. (setq load-path (cons  "<Erlang OTP 安装路径>/lib/tools-<版本号>/emacs" 
  3. load-path)) 
  4. (setq erlang-root-dir "<Erlang OTP 安装路径>"
  5. (setq exec-path (cons "<Erlang OTP 安装路径>/bin" exec-path)) 
  6. (require 'erlang-start) 
  7.   
  8. ;; This is needed for Distel setup 
  9. (let ((distel-dir "<Distel 解压位置的路径>/elisp")) 
  10. (unless (member distel-dir load-path) 
  11. ;; Add distel-dir to the end of load-path 
  12. (setq load-path (append load-path (list distel-dir))))) 
  13. (require 'distel) 
  14. (distel-setup) 
  15. ;; Some Erlang customizations 
  16. (add-hook 'erlang-mode-hook 
  17.       (lambda () 
  18.         ;; when starting an Erlang shell in Emacs, default in the node name 
  19.         (setq inferior-erlang-machine-options '("-sname" "emacs")) 
  20.         ;; add Erlang functions to an imenu menu 
  21.         (imenu-add-to-menubar "imenu"))) 
  22.   
  23. ;; A number of the erlang-extended-mode key bindings are useful in the shell too 
  24. (defconst distel-shell-keys 
  25. '(("\C-\M-i"   erl-complete) 
  26. ("\M-?"      erl-complete)  
  27. ("\M-."      erl-find-source-under-point) 
  28. ("\M-,"      erl-find-source-unwind) 
  29. ("\M-*"      erl-find-source-unwind) 
  30. "Additional keys to bind when in Erlang shell."
  31.   
  32. (add-hook 'erlang-shell-mode-hook 
  33.       (lambda () 
  34.         ;; add some Distel bindings to the Erlang shell 
  35.         (dolist (spec distel-shell-keys) 
  36.           (define-key erlang-shell-mode-map (car spec) (cadr spec)))) 
 

 Distel 设置断点可能会有问题,需要注释掉 <Distel 路径>/elisp/edb.el 的两行代码:

 
  
  1. ;;  (unless (edb-module-interpreted-p module) 
  2. ;;    (error "Module is not interpreted, can't set breakpoints.")) 

二、给 Emacs 增加行号:

编辑 .emacs 添加配置:

 
  
  1. (require 'linum) 
  2. (global-linum-mode 1) 

 三、autocomplete

下载 auto-complete :http://cx4a.org/software/auto-complete/#Latest_Stable

随便解压个什么地方

打开 Emacs,输入 M-x load-file RET <Autocomplete 解压路径>/etc/install.el RET 

如果你没有改 Emacs 什么设置的话,这个操作是这样:Alt + x,注意窗口最下面一行会有一个黄底的 M-x 突出显示出来,并且光标会自动移到 M-x 后面,输入load-file,回车,输入 <Autocomplete 解压路径>/etc/install.el 回车

接着是输入安装路径,默认是 ~/.emacs.d,也不用改了..直接回车吧

.emcs.d 目录和 .emacs 文件是在同一路径下

编辑 .emacs 添加:

 

 
  
  1. (add-hook 'erlang-shell-mode-hook 
  2. (lambda () 
  3. ;; add some Distel bindings to the Erlang shell 
  4. (dolist (spec distel-shell-keys) 
  5. (define-key erlang-shell-mode-map (car spec) (cadr spec))))) 
  6.   
  7. (add-to-list 'load-path "~/.emacs.d/"
  8. (require 'auto-complete-config) 
  9. (add-to-list 'ac-dictionary-directories "~/.emacs.d//ac-dict"
  10. (ac-config-default

 

四、eflymake

下载最新的 Flymake:http://sourceforge.net/projects/flymake/

将 .el 文件解压到 ~/.emacs.d/ 下,注意别带路径过去

编辑 .emacs 添加:

 

 
  
  1. (require 'erlang-flymake) 

五、yasnippet

下载最新的 yasnippet-bundle:http://code.google.com/p/yasnippet/

把 yasnippet-bundle.el 解压到 ~/.emacs.d/

 
  
  1. (require 'yasnippet-bundle)