『Emacs』我的.emacs文件

參考: http://www.emacs.cn/DotEmacs/DotEmacs
http://ann77.stu.cdut.edu.cn/EmacsDisplayLineNumber.html

Update: 2007.8.14 By: Border

Code:
(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 "Border")
(setq user-mail-address "[email protected]")

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

;;界面字體背景顏色主題
(set-foreground-color "green")
(set-background-color "black")
(set-cursor-color "gold")
(set-mouse-color "gold")

;;禁用啓動信息
(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 'display-line-number)
;; 如果想所有打開的文件都顯示行的話就打開下面的註釋
(global-display-line-number-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:/border")

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



文件下載:
http://public.box.net/border 中的".emacs"和"display-line-number.el"
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章