`

Emacs配置文件(erlang开发)

阅读更多
;; This is needed for Erlang mode setup
(setq erlang-root-dir "F:/erlang-dev/erlang-home/erl5.9.1")
(setq load-path (cons "F:/erlang-dev/erlang-home/erl5.9.1/lib/tools-2.6.7/emacs" load-path))
(setq exec-path (cons "F:/erlang-dev/erlang-home/erl5.9.1/bin" exec-path))
(require 'erlang-start)

;; This is needed for Distel setup
(let ((distel-dir "F:/erlang-dev/erlang-home/erl5.9.1/lib/distel-4.03/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)
(distel-setup)

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

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

(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.
 '(transient-mark-mode (quote identity)))
 (custom-set-faces
 ;; 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.
 )

 ;;设置个人信息
(setq user-full-name "Estone")
(setq user-mail-address "estone@yeah.net")

 ;在标题栏提示你目前所在位置.
 (setq frame-title-format '("Emacs@"system-name": %b %+%+ %f"))

 ;;界面字体背景颜色主题
(set-foreground-color "black")
 (set-background-color "white")
 (set-cursor-color "black")
 (set-mouse-color "black")
 (set-default-font "Consolas-10")

 ;;禁用启动信息
(setq inhibit-startup-message t)

 ;;关闭烦人的出错时的提示声
(setq visible-bell t) 

;; 设置光标为竖线
(setq-default cursor-type 'bar) 

;;Tab设置4
 (setq default-tab-width 4) 
(setq tab-width 4)
 
;;光标靠近鼠标的时候,让鼠标自动让开,别挡住视线
;;(mouse-avoidance-mode 'animate)

 ;;下面的这个设置可以让光标指到某个括号的时候显示与它匹配的括号
(show-paren-mode t)
 (setq show-paren-style 'parentheses)

 ;; 加载显示行号模块
(require 'linum)
(setq linum-format "%3d ")
 
;对所有文件生效
(add-hook 'find-file-hooks (lambda () (linum-mode 1)))


;;显示当前所在的行号和列号
(column-number-mode t)

 ;;防止页面滚动时跳动
(setq scroll-margin 3
 scroll-conservatively 10000)

 ;; 所有的备份文件转移到~/backups目录下
;(setq backup-directory-alist (quote (("." . "~/backups"))))
 ;(setq version-control t)
 ;(setq kept-old-versions 2)
 ;(setq kept-new-versions 5)
 ;(setq delete-old-versions t)
 ;(setq backup-directory-alist '(("." . "~/backups")))
 ;(setq backup-by-copying t)
 ;; Emacs 中,改变文件时,默认都会产生备份文件(以 ~ 结尾的文件)。可以完全去掉
;; (并不可取),也可以制定备份的方式。这里采用的是,把所有的文件备份都放在一
;; 个固定的地方("~/var/tmp")。对于每个备份文件,保留最原始的两个版本和最新的
;; 五个版本。并且备份的时候,备份文件是复本,而不是原件。

;;不产生备份文件
(setq make-backup-files nil)

 ;;设置kill-ring-max(我不知道怎么翻译这个词:)为200,以防不测:)
(setq kill-ring-max 200)

 ;; 当有两个文件名相同的缓冲时,使用前缀的目录名做 buffer 名字,不用原来的
;; foobar<!----> 形式。
(setq uniquify-buffer-name-style 'forward)

 ;;显示日期
(setq display-time-day-and-date t)
 (display-time)

 ;;显示时间
(setq display-time-24hr-format t)
 (setq display-time-day-and-date t)
 (setq display-time-use-mail-icon t)
 (setq display-time-interval 10)

 ;; 设置时间戳,标识出最后一次保存文件的时间。
(setq time-stamp-active t)
 (setq time-stamp-warn-inactive t)
 (setq time-stamp-format "%:y-%02m-%02d %3a %02H:%02M:%02S K.T")

 ;;设置默认工作目录
(setq default-directory "F:/erlang-dev/erlang-workspace")

 ;;'y' for 'yes', 'n' for 'no'
 (fset 'yes-or-no-p 'y-or-n-p) 


;; 代码折叠
(load-library "hideshow")
 (add-hook 'java-mode-hook 'hs-minor-mode)
 (add-hook 'perl-mode-hook 'hs-minor-mode)
 (add-hook 'php-mode-hook 'hs-minor-mode)
 (add-hook 'emacs-lisp-mode-hook 'hs-minor-mode)

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; 启动最大化窗口设置 - START
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;(defun w32-restore-frame ()
;; "Restore a minimized frame"
;; (interactive)
;; (w32-send-sys-command 61728))
;; (defun w32-maximize-frame ()
;; "Maximize the current frame"
;; (interactive)
;; (w32-send-sys-command 61488))
 ;;; Maximum Windows Frame
 ;;(w32-maximize-frame)
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; 启动最大化窗口设置 - END
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 ;;(autoload 'project-mode "project-mode" "Project Mode" t)
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics