emacs erlang ,debug,高亮,函数跳转,重构,错误提示,自动补全。一个都不少

原创 2012年03月21日 15:40:59

原来写过一篇  http://www.erlangchina.net/home-space-uid-11136-do-blog-id-68.html

但是那时候还有问题还未解决。现在可以了。但是没有时间详细写。我 贴出自己emacs配置吧,然后有问题可以来qq我。309843467   。dp

(setq default-directory "~/workspace/erlang/")

(global-set-key (kbd "C-SPC") 'nil)
;; share clipboard with outside programs
(setq x-select-enable-clipboard t)

(tool-bar-mode nil)
;;(menu-bar-mode nil)
(scroll-bar-mode nil)
(setq make-backup-files nil)
;; 设置另外一些颜色:语法高亮显示的背景和主题,区域选择的背景和主题,二次选择的背景和选择
(set-face-foreground 'highlight "white")
(set-face-background 'highlight "blue")
(set-face-foreground 'region "cyan")
(set-face-background 'region "blue")
(set-face-foreground 'secondary-selection "skyblue")
(set-face-background 'secondary-selection "darkblue")
(set-foreground-color "grey")
(set-background-color "black")
(set-cursor-color "gold1")
(set-mouse-color "gold1")
;;(set-scroll-bar-mode nil)
(setq-default cursor-type 'bar)
(setq frame-title-format
        '("  dp - Emacs   -   [ " (buffer-file-name "%f \]"
                (dired-directory dired-directory "%b \]"))))
(set-frame-height (selected-frame) 65)
(set-frame-width (selected-frame) 170)

(setq inhibit-startup-message t);关闭起动时LOGO
(setq visible-bell t);关闭出错时的提示声
(setq default-major-mode 'erlang-mode);一打开就起用 text 模式
(global-font-lock-mode t);语法高亮
(auto-image-file-mode t);打开图片显示功能
(fset 'yes-or-no-p 'y-or-n-p);以 y/n代表 yes/no
(column-number-mode t);显示列号
(show-paren-mode t);显示括号匹配
(setq mouse-yank-at-point t);支持中键粘贴
(transient-mark-mode t);允许临时设置标记
(setq x-select-enable-clipboard t);支持emacs和外部程序的粘贴
(setq auto-save-default nil);关闭备份文件#xxx#

;;-----kill ring 长度
(setq kill-ring-max 200)
(require 'linum)
(global-linum-mode 1)

(global-set-key [(f12)] 'loop-alpha)  ;;玻璃
(global-set-key [f1] 'cua-mode)
(global-set-key [f2] 'undo)
(global-set-key [f4] 'kill-this-buffer)
(global-set-key [f5] 'replace-regexp) ;;支持正则表达式
(global-set-key [f6] 'replace-string)

(global-set-key [f8] 'erlang-mode)
(global-set-key [f7] 'ecb-activate) ;;定义F7键为激活ecb
(global-set-key [C-f7] 'ecb-deactivate)
(global-set-key [f11] 'delete-other-windows) ;;设置F11为删除其它窗口
 (global-set-key (kbd "C-c z") (quote shell))


(defun select-all ()
  "Select the whole buffer."
  (goto-char (point-min))
  ;; Mark current position and push it into the mark ring.
  (push-mark-command nil nil)
  (goto-char (point-max))
  (message "ok."))

(provide 'select-all)

(autoload 'select-all "select-all"
  "Select the whole buffer." t nil)

;; user defined keys

(global-set-key "\C-x\C-a" 'select-all)
;;-------------------glass style------------------

(setq alpha-list '((85 55) (100 100)))  
(defun loop-alpha ()  
  (let ((h (car alpha-list)))                  
    ((lambda (a ab)  
       (set-frame-parameter (selected-frame) 'alpha (list a ab))  
       (add-to-list 'default-frame-alist (cons 'alpha (list a ab)))  
       ) (car h) (car (cdr h)))  
    (setq alpha-list (cdr (append alpha-list (list h))))  

(setq load-path (cons "/opt/erl/lib/erlang/lib/tools-" load-path))
(setq erlang-root-dir "/opt/erl")
(setq exec-path (cons "/opt/erl/bin" exec-path))
(setq erlang-man-root-dir "/opt/erl/man")
(require 'erlang-start)

(add-to-list 'auto-mode-alist '("\\.erl?$" . erlang-mode))
(add-to-list 'auto-mode-alist '("\\.hrl?$" . erlang-mode))
(add-to-list 'load-path "~/.emacs.d/erlware-mode")


(let ((distel-dir "~/.emacs.d/distel/elisp"))
    (unless (member distel-dir load-path)
        ;; Add distel-dir to the end of load-path
        (setq load-path (append load-path (list distel-dir)))))

(require 'distel)

;; Some Erlang customizations

(add-hook 'erlang-mode-hook
  (lambda ()

  ;; when starting an Erlang shell in Emacs, default in the node name

    (setq inferior-erlang-machine-options '("-sname" "emacs"))
    ;; add Erlang functions to an imenu menu

    (imenu-add-to-menubar "imenu")))

;; prevent annoying hang-on-compile
(defvar inferior-erlang-prompt-timeout t)

;; tell distel to default to that node
(setq erl-nodename-cache
        ;; Mac OS X uses "name.local" instead of "name", this should work
        ;; pretty much anywhere without having to muck with NetInfo
        ;; ... but I only tested it on Mac OS X.
        (car (split-string (shell-command-to-string "hostname"))))))

;; A number of the erlang-extended-mode key bindings are useful in the shell too
(defconst distel-shell-keys
  '(("\C-\M-i"   erl-complete)
    ("\M-?"      erl-complete)
    ("\M-."      erl-find-source-under-point)
    ("\M-,"      erl-find-source-unwind)
    ("\M-*"      erl-find-source-unwind)
  "Additional keys to bind when in Erlang shell.")

(add-hook 'erlang-shell-mode-hook
  (lambda ()
;; add some Distel bindings to the Erlang shell
        (dolist (spec distel-shell-keys)
        (define-key erlang-shell-mode-map (car spec) (cadr spec)))))


(setq load-path (cons "~/.emacs.d/esense-1.12" load-path))
(require 'esense-start)
(setq esense-indexer-program "~/.emacs.d/esense-1.12/esense.sh")


(defun flymake-erlang-init ()
    (let* ((temp-file (flymake-init-create-temp-buffer-copy
           (local-file (file-relative-name
                       (file-name-directory buffer-file-name))))
    (list "/usr/local/bin/emakefly" (list local-file))))

(add-to-list 'flymake-allowed-file-name-masks '("\\.erl\\'" flymake-erlang-init))
(add-hook 'find-file-hook 'flymake-find-file-hook)

;; cedet
(load-file "~/.emacs.d/cedet-1.0/common/cedet.el")
(global-ede-mode 1)                      ; Enable the Project management system
(semantic-load-enable-code-helpers)      ; Enable prototype help and smart completion
(global-srecode-minor-mode 1)            ; Enable template insertion menu

(add-to-list 'load-path "~/.emacs.d/ecb-2.40")
(require 'ecb)
;;(require 'ecb-autoloads)
;;(setq ecb-auto-activate t)
(setq ecb-tip-of-the-day nil)

;; tabbar
(add-to-list 'load-path "~/.emacs.d/tabbar")
(require 'tabbar)
(tabbar-mode t)
(global-set-key [(meta j)] 'tabbar-backward)
(global-set-key [(meta k)] 'tabbar-forward)

;;--------------------- tabbar----------
(set-face-attribute 'tabbar-default-face nil
                    :family "DejaVu Sans Mono"
                    :background "gray80"
                    :foreground "gray30"
                    :height 1.0
(set-face-attribute 'tabbar-button-face nil
                    :inherit 'tabbar-default
                    :box '(:line-width 1 :color "yellow70")
(set-face-attribute 'tabbar-selected-face nil
                    :inherit 'tabbar-default
                    :foreground "DarkGreen"
                    :background "LightGoldenrod"
                    :box '(:line-width 2 :color "Darkgoldenrod")
                    :overline "black"
                    :underline "black"
                    :weight 'bold
(set-face-attribute 'tabbar-unselected-face nil
                    :inherit 'tabbar-default
                    :box '(:line-width 2 :color "#00B2BF")
  ;; 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.
 '(ecb-options-version "2.40")
 '(ecb-primary-secondary-mouse-buttons (quote mouse-1--C-mouse-1)))
  ;; custom-set-faces 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.

;; --------- wrangler -----------------------
(add-to-list 'load-path "/usr/local/share/wrangler/elisp")
(require 'wrangler)


(add-to-list 'load-path
(require 'yasnippet-bundle)


;;(add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
;;(require 'auto-complete-config)
(add-to-list 'load-path "~/.emacs.d/")
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d//ac-dict")


转载:http://blog.csdn.net/liang890319/article/details/6938453 当前的Emacs发行版是Emacs21,它的特点是中文的输入和显示的配置麻...
  • chen190735341
  • chen190735341
  • 2015-01-28 20:45:40
  • 1098

erlang vm debug 调试编译

1. download source code tar -xzvf otp_src-18.3.tar.gz 2. cd /root/source/otp_src_18.3 3. export ERL_...
  • yangzm
  • yangzm
  • 2017-05-09 11:52:40
  • 241

emacs erlang ,debug,高亮,函数跳转,重构,错误提示,自动补全。一个都不少

原来写过一篇  http://www.erlangchina.net/home-space-uid-11136-do-blog-id-68.html 但是那时候还有问题还未解决。现在可以了。但是...
  • dp0304
  • dp0304
  • 2012-03-21 15:40:59
  • 6487

Emacs实现C++ 语法高亮、自动补全、各种跳转

  • JamesChen1988
  • JamesChen1988
  • 2012-05-07 09:09:31
  • 2963


Emacs-107-开启全局自动补全模式       这个本来在我自己配置的配置中也实现了,但是在spacemacs中没有实现。在spacemacs中使用这个功能主要分为两步:第一步是安装;第二步是开...
  • grey_csdn
  • grey_csdn
  • 2018-03-07 21:26:28
  • 28

Emacs Lisp程序单步调试

原址emacs运行过程中有时候会报错,这时我们需要对其进行debug(调试)。打开调试开关执行M-x toggle-debug-on-error打开debug开关,这样当emacs出错的时候会进入de...
  • u010164190
  • u010164190
  • 2018-03-16 10:48:54
  • 74

Erlang window环境搭建篇

Erlang百度百科介绍如下:            Erlang是一个结构化,动态类型编程语言,内建并行计算支持。最初是由爱立信专门为通信应用设计的,比如控制交换机或者变换协议等,因此非常适合于构...
  • cny901111
  • cny901111
  • 2012-06-10 20:53:38
  • 4177

emacs 括号自动高亮

推荐使用highlight-parentheses mode用list-packages安装,然后在init.el中添加(require 'highlight-parentheses) (define...
  • sheismylife
  • sheismylife
  • 2015-10-15 19:51:42
  • 2793


折腾半年多了,总算是找到个比较合适的方式。 我的选择是cedet+ecb+global gnu-global是一个兼容tag工具,看名字就知道它打算怎么干活的了。gtags是emacs下与glob...
  • bigmarco
  • bigmarco
  • 2011-11-04 10:22:36
  • 11068

【erlang 学习】 tsung 源代码分析 怎么debug tsung

本人是大三,初学erlang,是个菜鸟。若觉得这篇文章没有水平,那么sorry,浪费你时间了。我仅是做个笔记而已。   环境:   系统:ubuntu 10.10   erlang版本: R...
  • dp0304
  • dp0304
  • 2012-03-26 13:45:49
  • 2844
您举报文章:emacs erlang ,debug,高亮,函数跳转,重构,错误提示,自动补全。一个都不少