Debian下使用GNU Emacs
Emacs是一种病,用上之后就会上瘾 :)
大致过程是这样:
apt-get install emacs21
apt-get install mule-gbk
装好之后参考/usr/share/doc/mule-gbk/下的README
修改~/.emacs和~/.Xdefaults
下面是我的.emacs和.Xdefaults
;;-------------------------中文设定--------------------------
;; 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-------------------
;;
;;到上面的网页下载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 "") 'tabbar-backward-group)
(global-set-key (kbd "") 'tabbar-forward-group)
(global-set-key (kbd "") 'tabbar-backward)
(global-set-key (kbd "") 'tabbar-forward)
;;使用Win+方向键在tabbed buffer之间切换
~/.Xdefaults
Emacs.Fontset-0: -*-fixed-medium-r-normal-*-16-*-*-*-*-*-fontset-normal,\
chinese-gb2312:-sim-simsun-medium-r-normal--16-*-*-*-*-*-gb2312*-*,\
chinese-cns11643-5:-sim-simsun-medium-r-normal--16-*-*-*-*-*-gbk-0,\
chinese-cns11643-6:-sim-simsun-medium-r-normal--16-*-*-*-*-*-gbk-0,\
chinese-cns11643-7:-sim-simsun-medium-r-normal--16-*-*-*-*-*-gbk-0,\
chinese-big5:-*-*-medium-r-normal-*-16-*-big5*-*,\
korean-ksc5601:-*-medium-r-normal-*-16-*-ksc5601*-*,\
chinese-gbk:-sim-simsun-medium-r-normal--16-*-*-*-*-*-gbk-0,\
mule-unicode-0100-24ff: \
-misc-fixed-medium-r-normal--16-*-*-*-*-*-iso10646-1
Emacs.Font: fontset-normal
修改好了之后可以运行命令xrdb -merge .Xdefault使改变立即生效
如果你的系统里没有sim-simsun字体
可以用xlsfonts看看有哪些字体可以用
原文地址:
阅读(1076) | 评论(0) | 转发(0) |