当前位置: 首页 > 图文教程 > 操作系统 > Unix/Linux > 我的emacs设定。

Unix/Linux
FreeBSD完全入门手册
FreeBSD中启用3D加速功能的方法
光盘安装OpenBSD3.6的方法
硬盘安装OpenBSD 3.6的方法
FreeBSD局域网内升级Ports Tree及Port的安装
FreeBSD 数据备份和迁移方法
让root用户telnet到FreeBSD的方法
OPENBSD-3.8上快速安装和配置apache+mysql+php+ssl
用OpenBSD 3.8 release自带的FTPD架设FTP服务器
freebsd 常用命令
FreeBSD系统SSH配置详解
FreeBSD 6.2用freebsd-update升级过程
FreeBSD双线负载均衡NAT服务器配置方法
FreeBSD系统下读写 NTFS分区
Freebsd7.0 Apache2.2+MySQL5+PHP5安装和配置方法
freebsd6.2 nginx+php+mysql+zend系统优化防止ddos攻击
FreeBSD5.2.1上建立功能完整的邮件服务器(POSTFIX)
FreeBSD学习经验
FREEBSD系统优化精华
FreeBSD su Sorry问题解决办法

Unix/Linux 中的 我的emacs设定。


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-01   浏览: 131 ::
收藏到网摘: n/a

我的emacs设定,尽管还不是非常的舒服,不过已经够可以的了。
;-------------------------中文设定--------------------------;; 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 "") '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之间切换;;加载了 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)