Chinaunix首页 | 论坛 | 博客
  • 博客访问: 724371
  • 博文数量: 251
  • 博客积分: 10367
  • 博客等级: 上将
  • 技术积分: 2750
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-10 14:43
文章分类

全部博文(251)

文章存档

2009年(2)

2008年(86)

2007年(163)

分类: LINUX

2008-03-13 22:40:29

Emacs---伪装成编辑器的操作系统!

于是决定放弃Vi,开始学Emacs...

狂搜5个多小时,终于基本配置好了emacs

首先要说明的是,.emacs.d是一个默认的加载文件,它就隐藏在~(你的主目录)下面!

首先下载 color-theme.el 1,然后把它放在你的加载路径里面,最后在你的 ~/.emacs 里面加上 (require 'color-theme) 就可以使用了。现在重新启动一下 Emacs ,然后就可以用 M-x color-theme-select 来选择你喜欢的颜色主题了,它会打开一个列表,在每个列表项目上回车会应用那个颜色主题,如果选上了某个主题,按一下 d ,会出现类似:

color-theme-sitaramv-nt is an interactive compiled Lisp function in `color-theme.el'.
(color-theme-sitaramv-nt)
Black foreground on white background.
Includes faces for font-lock, widget, custom, speedbar.
[back]

的东西,其中那句 (color-theme-sitaramv-nt) 加入到你的 ~/.emacs 里面去,就可以永久应用这个颜色主题了。


显示行号
1, 下载wb-line-number.el, 放到合适的目录. (我一般放在~/.emacs.d中)

2, 在~/.emacs中添加:

(set-scroll-bar-mode nil) ;; no scroll bar, even in x-window system (recommended)
(require 'wb-line-number)
(wb-line-number-toggle)

3.自动缩进问题
 ;; 交换这两个按键。因为大多数情况下,回车后是要缩进的。
(global-set-key "\C-m" 'newline-and-indent)
(global-set-key "\C-j" 'newline)

4.自动补齐
Emacs 自带的hippie-expand (参考的是王垠的)
hippie-expand是 Emacs 自带的功能,
把M-/ 绑定到 hippie-expand,在.emacs文件中加入
;;绑定按键
(global-set-key [(meta ?/)] 'hippie-expand)

5.如何不重新启动 Emacs 就让 .emacs 的配置起作用
    *  用 emacs 打开 .emacs 文件,C-x C-e 光标前面的运行一条语句。立即生效。
    * 选择一个 region , M-x eval-region
    * M-x load-file ~/.emacs
    * M-x eval-buffer

都是立即生效,可以马上试验一条语句的效果。 例如,在任何一个文件中,写

(setq frame-title-format "emacs@%b")

把光标停在在这条语句后面, C-x C-e ,马上看到 emacs 的 标题栏上发生变化。

我用这种方法调试我的每一个小的配置文件,按上篇文章说的方法, 把他放在 ~/Emacs/myconfig/my-site-start.d 中。

6。xcscope.el的下载链接:

7.M-复制

入门后,再接着搜搜搜,就达到了下面的效果


阅读(825) | 评论(0) | 转发(0) |
0

上一篇:Hello,perl world!

下一篇:Wonderful Emacs!

给主人留下些什么吧!~~