天天看點

Emacs筆記——配置篇(不斷更新中)

~/.emacs

以下 .emacs 是我跟據 http://linux.hiweed.com/node/1391 的文章《Debian下使用GNU Emacs》修改了一下得來的,謝謝原作者嘻嘻。

;;-------------------------中文設定--------------------------

;; Setup GBK environment

(set-terminal-coding-system 'euc-cn)

(set-keyboard-coding-system 'euc-cn)

(set-language-environment 'Chinese-GB)

(setq locale-coding-system 'utf-8)

(setq current-language-environment "Chinese-GBK")

(prefer-coding-system 'utf-8)

;;-------------------------向其他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 "[email protected]%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)

繼續閱讀