我的emacs设定。
时间:2005-05-18 来源:xueyan
  ;-------------------------中文设定--------------------------
  ;; Setup GBK environment
  (require 'mule-gbk)
  (set-terminal-coding-system 'chinese-gbk)
  (set-keyboard-coding-system 'chinese-gbk)
  (set-language-environment 'chinese-gbk)
  (setq locale-coding-system 'chinese-gbk)
  (setq current-language-environment "Chinese-GBK")
  ;; Setup X Selection for mule-gbk
  (mule-gbk-selection-setup)
  (prefer-coding-system 'gbk)
  
  ;;-------------------------向其他X程序粘贴中文---------------
  (when (fboundp 'utf-translate-cjk-mode)
  ;; Load modified utf-translate-cjk-mode
  (require 'gbk-utf-mode)
  ;; Turn on utf-translate-cjk-mode
  (utf-translate-cjk-mode 1)
  ;; Setup X selection for unicode encoding
  (setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)))
  
  ;;-------------------------语法加亮--------------------------
  (global-font-lock-mode 't)
  
  ;;-------------------------关闭错误提示的Beep音--------------
  (setq visible-bell t)
  
  ;;-------------------------关闭启动时的`开机画面'------------
  (setq inhibit-startup-message t)
  
  ;;-------------------------显示列号--------------------------
  (setq column-number-mode t)
  
  ;;-------------------------括号匹配--------------------------
  ;;括号匹配时显示另一端的括号,而不是跳过去
  (show-paren-mode t)
  (setq show-paren-style 'parentheses)
  
  ;;-------------------------标题拦显示buffer的名字------------
  (setq frame-title-format "emacs@%b")
  
  ;;-------------------------Shell 使用 ansi color-------------
  (autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
  (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
  
  ;;-------------------------使用Win下的选择习惯---------------
  ;;用shift+方向键进行选择
  (pc-selection-mode)
  
  ;;-------------------------让Emacs拥有tabs-------------------
  ;;http://learn.tsinghua.edu.cn/homepage/2001315450/emacs_elisp.html
  ;;到上面的网页下载tabbar.el 保存到/usr/share/emacs/site-lisp/
  (require 'tabbar)
  (tabbar-mode)
  (define-prefix-command 'lwindow-map)
  ;;(global-set-key (kbd "") 'lwindow-map)
  ;;这儿的设定王垠的主页显示有问题,
  (global-set-key (kbd "<s-up>") 'tabbar-backward-group)
  (global-set-key (kbd "<s-down>") 'tabbar-forward-group)
  (global-set-key (kbd "<s-left>") 'tabbar-backward)
  (global-set-key (kbd "<s-right>") 'tabbar-forward)
  ;;使用Win+方向键在tabbed buffer之间切换
  ;;加载了 session 之后菜单上会多两项:最近访问过的文件和最近修改过的文件 /usr/share/emacs/site-lisp/session.el
  (require 'session)
  (add-hook 'after-init-hook 'session-initialize)
  ;;保存上次打开的文件记录
  (load "desktop")
  (desktop-load-default)
  (desktop-read)
  ;;如果session跟desktop配合,下次启动Emacs 的时候,就像根本没有关闭 Emacs 一样
  ;;把这几行加入 .emacs 就可以把 C-x C-b 那个普通的 buffer menu 换成非常方便的 ibuffer 啦
  (require 'ibuffer)
  (global-set-key (kbd "C-x C-b") 'ibuffer)
  ;;最方便的切换buffer,寻找文件的扩展
  (require 'ido)
  (ido-mode t)
  ;;使用这个,你就可以方便的在最近编辑的 buffer 之间切换了。切换的时候会出现一个小窗口显示附近的buffer,就像翻页一样
  (require 'swbuff)
  (global-set-key (kbd "") 'swbuff-switch-to-previous-buffer)
  (global-set-key (kbd "") 'swbuff-switch-to-next-buffer)
  (setq swbuff-exclude-buffer-regexps
       '("^ " "\*.*\*"))
  
  (setq swbuff-status-window-layout 'scroll)
  (setq swbuff-clear-delay 1)
  (setq swbuff-separator "|")
  (setq swbuff-window-min-text-height 1)
  ;;ecb
  ;;(add-to-list 'load-path "/usr/share/emacs/site-lisp/ecb")
  ;;(require 'ecb)
  
  (custom-set-variables
    ;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
    ;; Your init file should contain only one such instance.
   '(ecb-options-version "2.27"))
  (custom-set-faces
    ;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
    ;; Your init file should contain only one such instance.
   )
  ;;设定显示时间
  (setq display-time-24hr-format t)
  (setq display-time-day-and-date t)
  (display-time)










