LinuxGem
此处为老的 LinuxGem,新版 LinuxGem 请移步 www.linuxgem.org

Emacs 学习资源

galeki posted @ 2008年7月30日 16:29 in 文档编辑与排版 with tags emacs , 6230 阅读

本文档是我的 Emacs 学习笔记,其中收集了目前相对较新的 Emacs 学习资料,采取由浅入深的顺序归类整理,适合新手。

1. Emacs 23 安装与配置

Emacs 当前稳定版本是 Emacs 22.2,对于中文用户,这个版本及以前版本都是不堪用的,因为它们对中文的默认支持较差。Emacs 23 是 Emacs CVS 中的一个分支,该分支将 Emacs 的内部编码机制改为 Unicode 编码,对于中文的支持较以往版本的 Emacs 更为自然。另外,Emacs 23 支持 xft 字体,允许用户直接使用系统所安装的 TTF & OTF 字体。所以,即使 Emacs 23 目前还处于开发阶段,但还是推荐使用,但需要你从 Emacs CVS 仓库中迁出代码自行编译。详见答治茜同学所写的 Emacs 23 编译与安装指南

2. Emacs 新手指南

运行 Emacs,键入 "C-h t",可打开 Emacs 快速指南,悉心阅读、操练之,大概需要观看一部电影的时间即可上手。

注:"C-h t" 表示摁下 Ctrl 键时输入 h,然后松开 Ctrl 键再输入 t。

Emacs 快速指南只能帮助你对 Emacs 的操作大概有所了解,若要真正地上手使用 Emacs,需从配置 Emacs 开始。Emacs 的配置文件为 $HOME/.emacs,下面是一份较为简单的配置示例,可以让你对 Emacs 的配置有所认识,另外该示例也很好地解决了 Emacs 的中文字体问题。

; 设置字体
(set-default-font "Bitstream Vera Sans Mono-12")
(set-fontset-font (frame-parameter nil 'font)
              'han '("AR PL New Sung"."unicode-bmp"))

; 文本行间距
(setq-default line-spacing 4)

; 关闭启动时的 “开机画面”
(setq inhibit-startup-message t

; 把 yes or no 换为 y or n
(fset 'yes-or-no-p 'y-or-n-p)
 

注意,由于上述 .emacs 文件中使用了 xft 字体渲染功能,那么需要在 $HOME/.Xresources 文件中添加以下内容(若没有这个文件,可创建之):

Emacs.FontBackend: xft
Xft.antialias: yes
Xft.hinting: yes
Xft.hintstyle: hintfull
Xft.dpi: 96

欲使 .Xresources 文件立即生效,需在终端下执行:

$ xrdb -merge ~/.Xresources

配置文件中所出现的代码之意,可以不去理会,日后随着对 Emacs 的熟悉,渐渐就领会了。

现在你已经朝向 Emacs 的世界迈出了第一步,已经可以较为自如地使用 Emacs 编辑普通的文本文档了。下一步推荐阅读 pluskid 写的 Emacs 生存指南,这份文档非常适合已经对 Emacs 产生兴趣的同学。

至此,我们对 Emacs 的配置已经有了基本认识,若依然未被 Emacs 的复杂性所吓住,那么在闲暇之余可以读读 Emacs 生存指南前言部分所推荐的那些个人笔记了。

3. 端正一下学习态度

传说 Emacs 是一个伪装成文本编辑器的操作系统。Emacs 的确不仅仅是一个文本编辑器,尽管它的本意是如此。历经三十余年的淬炼以及无数黑客的智慧投入,Emacs 早已演绎为一种内涵丰富的黑客文化,为程序员们营造了一种颇有情趣的生活氛围。因此很多人都宣称自己信仰 Emacs 或宣称自己生活在 Emacs 中,这并非是过誉之辞。所以,若想真正地进入 Emacs 的奇妙世界,需要撇去太多的功利之心,通过学用 Emacs 这一工具来领悟蕴涵于其中的文化。

如果你不认同 Emacs 是一种文化,而且你仅仅需要一种功能强大的文本编辑器,那么学习 Emacs 对你而言或许会变成一种无益的折磨,那些不愿透漏姓名的人建议你改用 Vim。

4. 系统地学习 Emacs

若想真正地掌握 Emacs,寻一本系统而详细的教程来看是非常必要的:

  • Sams Teach Yourself Emacs in 24 Hours, 虽是英文书,但语言浅显易懂,既学习了 Emacs,又提高了一些英文文档阅读能力,何乐而不为?不过,且莫天真地认为 24 个小时就可以读完这本书,每天读它所规定的 1 个小时的内容即可。只不过这本书比较老了,书中有些内容与 Emacs 23 的功能不匹配,阅读时注意一下。
  • Learning Gnu Emacs 3rd Edition,也是英文的,很详细地介绍了 Emacs 的各大主要功能,要读完它,也需要一些毅力,不过它比 24 Hours 要新。
  • IBM developerWorks 中国上有Emacs 编辑环境文档系列,深入浅出地介绍了 Emacs 的应用全貌;很高兴告诉你,这份文档是中文的。

Emacs 的中文学习资源,还应当推荐一下 http://www.emacs.cn

Alex 说:
2008年7月30日 19:09 王垠以前的主页貌似不见了. 不然虽然有点crazy, 但东西还是不错的.
princelai 说:
2008年7月30日 20:10 我想要VIM的……
希罗 说:
2008年7月30日 23:30 哎,想用Emacs还久了,不过就是没法子静下心来啊.
ln 说:
2008年7月31日 02:09 还没决定到底是学 vim 还是 emacs,两者真的很难取舍……
gmj 说:
2008年7月31日 23:58 都试试看就好了,这个也是因人而异。 比如有的人就是很不习惯vim要经常按esc, 同样有人就是不习惯emacs要经常按ctrl :-D 。
garfileo 说:
2008年8月01日 02:04 Emacs 与其它工具的整合效果要优于 Vim,譬如 AucTeX、Emacs GDB、Emacs Wiki...
Victsm 说:
2008年8月01日 02:07 不知道有没人出个vim的手册呢
garfileo 说:
2008年8月01日 03:21 vim 最近有一本很好的书,请google “hacking vim”
liumailong 说:
2008年8月01日 13:29 说句题外话:你的网站在没图标,那个图标叫什么忘了。就是显示在收藏夹的那个
walter 说:
2008年8月04日 18:52 王垠的个人主页还有: http://hi.chinaunix.net/batch.viewlink.php?itemid=4724 上面有些挺不错的东西(关于emacs ,fvwm, linux, etc).
poet 说:
2008年8月04日 21:47 > 比如有的人就是很不习惯vim要经常按esc, > 同样有人就是不习惯emacs要经常按ctrl :-D 。 不习惯esc的可以改按Ctrl-[ 效果相同。 但是不习惯按ctrl的人呢,不知道有没有什么好办法解决?
cnlions 说:
2008年8月04日 22:40 emacs和vim都用着呢。 用emacs auctex cdlatex xdvi写文章,记笔记。 用vim编辑一般的文本文件,如.emacs。 呵呵
galeki 说:
2008年8月05日 10:30 @cnlions: 当初就是因为要经常编辑配置文件才选择的 vim,emacs 启动有点慢。没想到你双管齐下了~ :-D
wanzigunzi 说:
2008年8月06日 10:21 唔,hacking vim,我去hack hack
fancycode 说:
2008年8月07日 21:23 我讨厌vim
Alex 说:
2008年8月08日 12:05 @galeki: 启动了emacs之后用emacs-client来调用emacs还是很快的. 同时编辑配置文件的话, 可以用generic-mode来处理系统常见文件的高亮配置.
galeki 说:
2008年8月09日 00:44 @Alex: 原来如此~ :-D
答治茜 说:
2008年11月19日 02:10

呵呵,搜索自己的名字,看到了你,上来打个招呼,认识下。

Head_small
galeki 说:
2008年11月19日 07:55

嘿嘿,欢迎下作者~ :)

fdfd 说:
2021年3月12日 23:09

Much obliged for setting aside an ideal opportunity to examine this, I feel firmly about it and affection adapting more on this subject.  Buy DMT

amelia 说:
2021年3月14日 23:04

Cool stuff you have and you keep redesign every one of us.  bulk sunglasses

amelia 说:
2021年3月18日 06:05

Much obliged such a great amount for this data. I need to tell you I agree on a few of the focuses you make here and others may require some further survey, yet I can see your perspective.  wholesale handbags and purses

amelia 说:
2021年3月18日 06:05

a debt of gratitude is in order for the tips and information..i truly welcome it..  wholesale accessories online

amelia 说:
2021年4月02日 18:22

I can see that you are a specialist at your field! I am dispatching a site soon, and your data will be extremely helpful for me.. Much obliged for all your help and wishing all of you the accomplishment in your business.  build backlinks

chalsea 说:
2021年4月14日 21:22

Thankyou for this wondrous post, I am happy I watched this site on yippee.  lsd for sale

ch 说:
2022年1月25日 04:14

Positive site, where did u come up with the information on this posting? I'm pleased I discovered it though, ill be checking back soon to find out what additional posts you include. https://www.5g999.co/slot

ch 说:
2022年2月14日 03:37

Respecting the time and exertion you put into your site and nitty gritty data you offer!.. https://www.jdb289.com

ch 说:
2022年2月14日 03:38

I have perused your online journal it is exceptionally useful for me. I need to express profound gratitude to you. I have bookmark your site for future redesigns. https://HubJOKER888.com

amelia 说:
2022年7月03日 01:31

A debt of gratitude is in order for setting aside an ideal opportunity to examine this, I feel emphatically about it and affection adapting more on this theme. On the off chance that conceivable, as you pick up skill, would you psyche overhauling your online journal with more data? It is to a great degree supportive for me. corporate office contact


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter