我的Emacs 配置

一直断断续续地使用着emacs,曾经也配置过Emacs以编写代码,现在基本上熟练了基础使用。

断断续续对其进行过设置,但中间有好些东西忘记了又重新找资料设置,然后过段时间又要再搜资料。好记性不如烂笔头啊。

现在觉得遇到一点瓶颈,再抽一两天时间翻资料,设置。其间大部分资料都是通过emacser.com获得

以下是我个人的一些设置过程:

 

在设置的过程中,记住经常使用M-x eval-buffer来检查效果,如果不对,则立即检查一下,这样有利于查错。

1. yasnippet.el
yasnippet有一系列的自动补全的模板可供使用,对写代码的速度非常有帮助。感谢作者pluskid. 可直接到此处下载http://code.google.com/p/yasnippet/
配置如下: 
Install with yasnippet-bundle.el

To quickly tryout YASnippet, download the simpler "bundle" version. If you plan to modify the bundled templates and/or build your own, download the "normal" package.

  1. Download yasnippet-bundle on the right sidebar and unpack it.
  2. You'll get a file named yasnippet-bundle.el, put it in ~/.emacs.d/plugins/ (create that directory if not exists).
  3. Open the file in Emacs, and type Alt+x eval-buffer.

 

That's it. Now open any file, you'll see a menu "YASnippet". You can pull down the menu to insert a template. Or, you can type a pre-defined abbrev and press TAB to expand it! To have Emacs load YASnippet automatically when it starts, put the following in your ~/.emacs file:

(add-to-list 'load-path
             "~/.emacs.d/plugins")
(require '
yasnippet-bundle)


2. header2.el
    header2.el可帮助方便地为源代码写版本及版权信息等。
    下载http://www.emacswiki.org/emacs-ja/header2.el
    配置:由于较长,请参见下面的.emacs文件内容。
3. cedet的配置
详细地请参见http://alexott.net/en/writings/emacs-devenv/EmacsCedet.html
   CEDET比较庞杂,我自己暂时还在摸索中。现在觉得用auto-complete已经足够。
4. CScope配置
http://lifegoo.pluskid.org/wiki/EmacsCscope.html
配置比较简单,使用(require 'xcscope)后即可有菜单项,刚开始记不熟快捷键可以多看一下菜单,等记住后即可直接用快捷键了,挺方便。
5 .Swap the Caps Lock and Ctrl
保护小手指的好方法。现在已经习惯,以致有时到一些另外的机器上的时候,经常会误按:p
http://lifegoo.pluskid.org/wiki/SwapCapsCtrl.html
6. 配置文件的保存
管理与配置文件的保存,可以供以后在多台不同的机器上快速地布署。可用版本管理工具,SVN或GIT随便挑,同时,可以利用ln创建快捷方式,将.emacs及.emacs.d都指定到你可以进行版本管理的目录。如下例子: ln -s /home/simon/demo /home/jules/mylink3 #Create mylink3 pointing to demo
我自己使用的方法
$ ls -l .emacs lrwxrwxrwx 1 laijw dev 46  .emacs -> /home/laijw/dreamstuff/emacsSettings/dot_emacs
$ ls -l .emacs.d lrwxrwxrwx 1 laijw dev 37  .emacs.d -> /home/laijw/dreamstuff/emacsSettings/ 

在.emacs及.emacs.d都建立了链接后,以后则可以方便地对其进行更改,并且,还可以利用版本管理工具对修改提交到网络进行存储。方便很多。

Emacs非常 强大,好些功能正在进一步摸索之中。

 

完整的.emacs文件如下

 

 

 

 

参考资料:

Emacs

http://alexpogosyan.com/color-theme-creator/ 在线对Emacs进行配色的网站,有点意思。

http://www.elliotglaysher.org/emacs/  很全的配置

C++

[1]。http://www.mysmu.edu/me2005/zhaopeng.2005/notes/Emacs.html 

[2]。http://www.xsteve.at/prg/emacs/  老外的较好的配置tips

 [3]. CEDET配置:http://alexott.net/en/writings/emacs-devenv/EmacsCedet.html

                            http://emacser.com/cedet.htm

 

PYthon

[1]. http://hide1713.wordpress.com/2009/01/30/setup-perfect-python-environment-in-emacs/  不错的文章

http://www.enigmacurry.com/2008/05/09/emacs-as-a-powerful-python-ide/

http://fayaa.com/code/view/767/

http://www.cnblogs.com/henrya2/archive/2009/02/21/1395612.html


Emacs python Completion : www.rwdev.eu/articles/emacspyeng

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值