博客首页 注册 建议与交流 排行榜 加入友情链接
推荐 投诉 搜索: 帮助

hope_process

I think ,therefore I am.
  heixia108.cublog.cn

关于作者
    既然目标是地平线

   留给世界的只能是背影
   
|| << >> ||
我的分类


Emacs 起步走
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的下载链接:http://www.abdelmalek.org/xcscope.el

7.M-复制

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


发表于: 2008-03-13,修改于: 2008-03-14 13:01,已浏览183次,有评论0条 推荐 投诉


网友评论
 发表评论