Emacser  - 讨论区

标题:我的emacs for winxp的配置

2010年12月27日 星期一 14:56

1、下载emacs for win

到这个网址可以下载到Emacs的windows版本: http://ftp.gnu.org/pub/gnu/emacs/windows/

2、安装

将下载的压缩包解压缩到任意目录,假设emacs的目录是D:/emacs/

点击运行,输入regedit,打开注册表,在 HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs(如果没有则手动添加项),在此项下添加字符串值,名称为HOME,值为D:\Emacs,

3、配置

 

配置文件压缩包到以下地址下载:

http://www.zeuux.org/file/group/content/264/

下载解压后

_emacs文件和site-lisp文件夹放到 emacs根目录

以下是_emacs文件的内容

Ps:目前的cscope暂时不好用,可以使用的功能有tabbar、ECB、Color、Tab(设定为4,使用空格替换Tab),其他功能以后添加,暂时使用它替代ue写c和java代码没有什么问题了(我不需要代码输入提示,所以没搞,有喜欢的朋友请参考小包同学的配置),只设定了英文字体,使用Monoca字体,有喜欢的朋友可以去这里下载 http://ishare.iask.sina.com.cn/f/4944524.html ,如果是在linux下使用的话,需要下载Monoca for Linux


**************************************************

(add-to-list 'load-path "emacs路径/site-lisp/") ;; make sure dir is the file's parent

;(require 'ido)

;(ido-mode t)

(setq make-backup-files nil) ; Don't want any backup files

;;Show line number

(require 'linum)

(global-linum-mode 1)

 

(require 'xcscope) ;;load xcscope

(require 'cedet) ;;load cedet

(require 'ecb) ;;load ecb

(require 'session) ;;session

(add-hook 'after-init-hook 'session-initialize) ;; initialize session when starup

(require 'doxymacs) ;;doxymacs

;;;;; ecb setup ;;;;;;;;;

;; auto start ecb and no daily tips

(setq ecb-auto-activate t

      ecb-tip-of-the-day nil)

;; set hot key about windows move

;;设定ECB快捷键 使用ALT+方向键可以快捷的在窗口直接跳跃

(global-set-key [M-left] 'windmove-left)

(global-set-key [M-right] 'windmove-right)

(global-set-key [M-up] 'windmove-up)

(global-set-key [M-down] 'windmove-down)

 

;; set hot key about display or hide ecb window

;;设定显示ECB的快捷键 Ctrl + F1 隐藏 Ctrl+F2 呼出

(define-key global-map [(control f1)] 'ecb-hide-ecb-windows)

(define-key global-map [(control f2)] 'ecb-show-ecb-windows)

 

;; set hot key about single window maximize

(define-key global-map "\C-c1" 'ecb-maximize-window-directories)

(define-key global-map "\C-c2" 'ecb-maximize-window-sources)

(define-key global-map "\C-c3" 'ecb-maximize-window-methods)

(define-key global-map "\C-c4" 'ecb-maximize-window-history)

;; set hot key about restore default size

(define-key global-map "\C-c`" 'ecb-restore-default-window-sizes)

 

;; autoload visual-basic-mode

;;我平时需要写一些vbs的脚本,所以增加了vbs脚本的支持

(autoload 'visual-basic-mode "visual-basic-mode" "Visual Basic mode." t)

(add-to-list 'auto-mode-alist '("\\.vbs\\'" . visual-basic-mode)) ;VBscript

(add-to-list 'auto-mode-alist '("\\.vb\\'" . visual-basic-mode))  ;visual basic .NET file

(add-to-list 'auto-mode-alist '("\\.bas\\'" . visual-basic-mode)) ;visual basic form

(add-to-list 'auto-mode-alist '("\\.frm\\'" . visual-basic-mode)) ;basic language source

(add-to-list 'auto-mode-alist '("\\.cls\\'" . visual-basic-mode)) ;C++ class definition file

 

(setq-default indent-tabs-mode nil)

 

;;Set auto indent

;(setq indent-tabs-mode nil)

(setq default-tab-width 4)

(setq tab-width 4)

(setq tab-stop-list ())

;;Set C language style

(add-hook 'c-mode-hook 'linux-c-mode)

(setq imenu-sort-function 'imenu--sort-by-name)

(defun linux-c-mode()

(define-key c-mode-map [return] 'newline-and-indent)

(interactive)

(c-set-style "K&R")

(c-toggle-hungry-state)

(setq c-basic-offset 4)

(imenu-add-menubar-index)

(which-function-mode)

)

;;No warning sound

(setq visible-bell nil)

;;Set default font

(set-default-font "Monaco-10")

;;Support copy and paste from other program

(setq x-select-enable-clipboard t)

;;No scroll bar

(scroll-bar-mode nil)

;;Display column number

(column-number-mode t)

;;

(setq-default transient-mark-mod t)

(transient-mark-mode t)

;;Show the other bracket

(show-paren-mode t)

;;No tool bar

(tool-bar-mode -1)

;;No menu bar

(menu-bar-mode -1)

;;

(global-font-lock-mode t)

;;Close the start window

(setq inhibit-startup-message t)

 

(require 'darkroom-mode)

 

(load-file "emacs路径/site-lisp/color-theme-6.6.0/themes/color-theme-library.el")

(require 'color-theme)

(color-theme-deep-blue)

(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.

 '(ecb-layout-window-sizes nil))

(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.

 )

 

;; tabbar

(require 'tabbar)

(tabbar-mode t)

;;设置快捷键

(global-set-key (kbd "M--") 'tabbar-backward-group)

(global-set-key (kbd "M-=") 'tabbar-forward-group)

(global-set-key (kbd "M-1") 'tabbar-backward)

(global-set-key (kbd "M-2") 'tabbar-forward)

 

;; increase kill ring for Undo

(setq kill-ring-max 100)

 

;; when ask "yes" or "no",use "y"or"n" for answer

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


 

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2024

    京ICP备05028076号