免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 950 | 回复: 0
打印 上一主题 下一主题

windows下.emacs的设置 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-05-19 22:56 |只看该作者 |倒序浏览
win下面也有比较好的emacs编译的版本,很多——其实也可以自己编译——甚至带有auctex。。在windows下面有个很简单的方法来找到.emacs到底在哪里。
        options-save options
emacs系统就会告诉你.emacs到底在哪里,并且会生成.emacs配置文件。
;;my own .emacs setup file:
;;其实用起来还是觉得vim顺手小巧。。。不过vim功能还是差一截呀
;;程序调试功能不说,一个简单的match brace功能都没有
;;据说vim 7.0加进去了这个功能,拭目以待
;;到时候就基本上可以不用emacs了
(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.
)
(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.
)
(line-number-mode t)
(setq default-directory "f:/Develop/")
(global-font-lock-mode t)
;no backup
(setq make-backup-files nil)
;K&R style c indent
(add-hook 'c-mode-hook
    '(lambda ()
    (c-set-style "K&R")))
(setq visible-bell t)
;关闭烦人的出错时的提示声。
(show-paren-mode t)
;显示匹配的括号
(setq-default transient-mark-mode t)
(setq inhibit-startup-message t)
(setq column-number-mode t)
(setq mouse-yank-at-point t)
;  不要在鼠标点击的那个地方插入剪贴板内容。我不喜欢那样,经常把我的文档搞的一团糟。我觉得先用光标定位,然后鼠标中键点击要好的多。不管你的光标在文档的那个位置,或是在 minibuffer,鼠标中键一点击,X selection 的内容就被插入到那个位置。
(setq kill-ring-max 200)
;    用一个很大的 kill ring. 这样防止我不小心删掉重要的东西。我很努莽的,你知道 :P
(setq default-fill-column 76)
;   把 fill-column 设为 60. 这样的文字更好读。
(setq-default indent-tabs-mode nil)
(setq default-tab-width 4)
(setq tab-stop-list ())
;(loop for x downfrom 40 to 1 do
;      (setq tab-stop-list (cons (* x 4) tab-stop-list)))
;  不用 TAB 字符来indent, 这会引起很多奇怪的错误。编辑 Makefile 的时候也不用担心,因为 makefile-mode 会把 TAB 键设置成真正的 TAB 字符,并且加亮显示的。
(setq sentence-end "\\([。!?]\\|……\\|[.?!][]\"')}]*\\($\\|[ \t]\\)\\)[ \t\n]*")
(setq sentence-end-double-space nil)
;    设置 sentence-end 可以识别中文标点。不用在 fill 时在句号后插入两个空格。
(setq enable-recursive-minibuffers t)
;可以递归的使用 minibuffer。我经常需要这么做。
(setq scroll-step 1
       scroll-margin 3
             scroll-conservatively 10000)
;防止页面滚动时跳动, scroll-margin 3 可以在靠近屏幕边沿3行时就开始滚动,可以很好的看到上下文。
(setq default-major-mode 'text-mode)
; 把缺省的 major mode 设置为 text-mode, 而不是几乎什么功能也没有的 fundamental-mode.
(setq show-paren-style 'parentheses)
;    括号匹配时显示另外一边的括号,而不是烦人的跳到另一个括号。
(mouse-avoidance-mode 'animate)
;光标靠近鼠标指针时,让鼠标指针自动让开,别挡住视线。
(setq frame-title-format "emacs@%b")
;;  在标题栏显示buffer的名字,而不是 emacs@wangyin.com 这样没用的提示。
(auto-image-file-mode)
;   让 Emacs 可以直接打开和显示图片。
(put 'set-goal-column 'disabled nil)
(put 'narrow-to-region 'disabled nil)
(put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil)
(put 'LaTeX-hide-environment 'disabled nil)
;把这些缺省禁用的功能打开。
(mapcar
  (function (lambda (setting)
                  (setq auto-mode-alist
                      (cons setting auto-mode-alist))))
   '(("\\.xml$".  sgml-mode)
          ("\\\.bash" . sh-mode)
         ("\\.rdf$".  sgml-mode)
            ("\\.session" . emacs-lisp-mode)
           ("\\.l$" . c-mode)
              ("\\.css$" . css-mode)
                 ("\\.cfm$" . html-mode)
                ("gnus" . emacs-lisp-mode)
                   ("\\.idl$" . idl-mode)))
;一个简单的办法设置 auto-mode-alist, 免得写很多 add-to-list.
(setq user-full-name "colois")
(setq user-mail-address "zhudp04@mails.tsinghua.edu.cn")
; 设置有用的个人信息。这在很多地方有用。
        
;; setup chinese language support
(set-language-environment 'Chinese-GB)
(create-fontset-from-fontset-spec
  "-*-Courier New-normal-r-*-*-10-*-*-*-c-*-fontset-most,
  chinese-gb2312:-*-MS Song-normal-r-*-*-12-*-*-*-c-*-gb2312-*,
  chinese-big5-1:-*-MingLiU-normal-r-*-*-12-*-*-*-c-*-big5-*,
  chinese-big5-2:-*-MingLiU-normal-r-*-*-12-*-*-*-c-*-big5-*" t)
(set-keyboard-coding-system 'chinese-iso-8bit)
(set-clipboard-coding-system 'chinese-iso-8bit)


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/16953/showart_115277.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP