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

Unix/Linux
Linux 备份 恢复方法
Linux玩CS反恐精英的方法
在一个ISO镜像中集成多个不同的linux发行版,可刻盘,可引导
Linux 快捷键使用
Linux DHCP 服务器配置方法介绍
Linux 22端口的修改方法
Linux 记录会话过程的命令
Linux 后台执行程序如何操作?
linux Wget命令来浏览网页的方法
Linux tail命令的巧妙应用
Wine 中文存在很多的乱码怎么解决方法
linux 新手教程之创建锁文件的方法
配置Linux 保证其系统的安全
Linux DHCP协议实现过程
Linux系统下破解SAM密码
linux/unix vi 编辑器用法详解
Linux 误删文件的解决方法
Linux系统下的历史记录删除方法
Red Hat Linux 安全设置指南
Linux基本命令-注销、关机、重启

Unix/Linux 中的 我的emacs设定。


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-01   浏览: 44 ::
收藏到网摘: 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)