`
yuanyu5237
  • 浏览: 159104 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

windows下emacs安装配置,我的emacs第一天

阅读更多
我的emacs:
第一天:下载http://www.gnu.org/software/emacs/

emacs-22.3-bin-i386

配置:

1,在D盘根目录下新建一个文件夹,取名Emacs22.3(也可以是其他路径,随个人喜好而定),将emacs-22.2-bin-i386.zip里的文件解压到这个目录下,这样在d:\Emacs22.3\下就有bin, tec, info, leim, lisp, site-lisp等目录。

双击bin文件夹里的runemacs.exe启动。注意到bin目录里还有个文件是emacs.exe,双击它也可以启动,但是会出现一个控制台窗口.,

2,打开注册表,找到HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs(如果没有则手动添加项),在此项下添加字符串值,名称为HOME,值为D:\Emacs22.3。

3,创建.emacs.d目录和.emacs文件,启动emacs,用鼠标点击Options菜单,随便点击一两个选项,比如点击一下Active Region Highlighting,然后点击Save Options。先不要担心你会破坏了什么东西,这样做的目的是让emacs自动创建.emacs.d目录以及.emacs文件!观察你的Emacs窗口最后一行,是否显示“Wrote d:/Emacs22.2/.emacs”?如果是的话就对了,当你选择Save Options的时候,Emacs会在home路径下产生.emacs文件,并把配置信息写进这个文件。现在看看你的d:\Emacs22.2\目录下是否产生了这两个东西?

4,加载.el文件,lisp目录下存放着lisp源文件(*.el)和已编译的lisp文件(*.elc),以后你也可以将自己的.el文件放在这个目录下,然后还要在.emacs文件插入相关语句。比如你有一个文件叫做abcd.el,将它复制到lisp目录下,然后打开.emacs文件插入一句(require 'abcd)就可以了(包括圆括号,不需要扩展名.el)。

如果你不喜欢lisp文件夹,也可以自己新建一个,比如在home目录下建一个文件夹叫做xyz,然后把abcd.el放在xyz目录下,在.emacs文件插入以下两句:
(setq load-path (cons "~/xyz" load-path))
(require 'abcd)

第一句告诉emacs先加载你的xyz目录,第二句再加载abcd.el。注意“~/”是linux系统的用法,表示home目录。



最后贴一下,我的.emacs(目前使用了一个显示行号的el,linum.el下载地址:

http://linux.cuit.edu.cn/tos-content/2009/06/linum.el)配置:

引用

(custom-set-variables

  ;; custom-set-variables was added by Custom.

  ;; If you edit it by hand, you could mess it up, so be careful.

  ;; Your init file should contain only one such instance.

  ;; If there is more than one, they won't work right.

;;不显示工具栏

'(tool-bar-mode nil)

'(transient-mark-mode t))

(custom-set-faces

  ;; custom-set-faces was added by Custom.

  ;; If you edit it by hand, you could mess it up, so be careful.

  ;; Your init file should contain only one such instance.

  ;; If there is more than one, they won't work right.

)



;;更改el文件的默认存放路径

;;(setq load-path (cons "d:/soft/green_soft/ntemacs23/site-lisp/" load-path))



;;----------------------------华丽的分割线-------------------------------------



;;去掉启动欢迎界面

(setq inhibit-startup-message t)



;;不要总是没完没了的问yes or no, 为什么不能用 y/n

(fset 'yes-or-no-p 'y-or-n-p)



;;不要生成临时文件

(setq-default make-backup-files nil)



;;括号匹配时显示另外一边的括号,而不是烦人的跳到另一个括号。

(show-paren-mode t)

(setq show-paren-style 'parentheses)



;;打开高亮 #M-x global-font-lock-mode

(global-font-lock-mode t)



;;把title设置为“文件名@LC's Emacs"

(setq frame-title-format

'("GNU/Emacs - [ " (buffer-file-name "%f \]"

(dired-directory dired-directory "%b \]"))))



;;光标靠近鼠标的时候,让鼠标自动让开,别挡住视线

(mouse-avoidance-mode 'animate)



;; 自动存盘

(setq auto-save-mode t)



;; 反显选中区域

(transient-mark-mode t)



;;(require 'wb-line-number)

;;缺省显示行号

;;(wb-line-number-enable)

;;显示行号 #M-x wb-line-number-toggle

;;另外一个显示行号的插件,个人更喜欢的风格

(require 'linum)

(global-linum-mode t)

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics