[原创]Emacs搭建java开发环境

Vim、Emacs配置和使用
回复
xiao2004
帖子: 56
注册时间: 2006-05-15 3:22
送出感谢: 0
接收感谢: 0

[原创]Emacs搭建java开发环境

#1

帖子 xiao2004 » 2007-03-15 23:46

1. sudo apt-get install sun-java5-jdk
2. download http://ftp.ubuntu.org.cn/emacs/myemacs.tar.gz
3. cd ~ && mkdir myemacs
4. tar -C ~/myemacs -cvxf myemacs.tar.gz
5. vi ~/.emacs (insert my .emacs)

6. emacs

看图:
图片

.emacs文件

代码: 全选

(setq default-major-mode 'text-mode);一打开就起用 text 模式。
(global-font-lock-mode t);语法高亮
(auto-image-file-mode t);打开图片显示功能
(fset 'yes-or-no-p 'y-or-n-p);以 y/n代表 yes/no,可能你觉得不需要,呵呵。
(column-number-mode t);显示列号
(show-paren-mode t);显示括号匹配
(display-time-mode 1);显示时间,格式如下
(setq display-time-24hr-format t)
(setq display-time-day-and-date t)
(tool-bar-mode nil);去掉那个大大的工具栏
(scroll-bar-mode nil);去掉滚动条,因为可以使用鼠标滚轮了 ^_^
(mouse-avoidance-mode 'animate);光标靠近鼠标指针时,让鼠标指针自动让开,别挡住视线。很好玩阿,这个功能
(setq mouse-yank-at-point t);支持中键粘贴
(transient-mark-mode t);这个忘了,郁闷!
(setq x-select-enable-clipboard t);支持emacs和外部程序的粘贴
(setq frame-title-format "xiao@%b");在标题栏提示你目前在什么位置。你要把zhan改成自己的用户名
(setq default-fill-column 80);默认显示 80列就换行 

(load-file "/home/xue/myemacs/color-theme.el")
(color-theme-dark-blue);选择 darkblue的配色方案 
(setq debug-on-error t) 

(add-to-list 'load-path (expand-file-name "~/myemacs/semantic-1.4.4"))
(add-to-list 'load-path (expand-file-name "~/myemacs/speedbar-0.14beta4"))
(add-to-list 'load-path (expand-file-name "~/myemacs/eieio-0.17"))
(add-to-list 'load-path (expand-file-name "~/myemacs/jde-2.3.5.1/lisp"))
(add-to-list 'load-path (expand-file-name "~/myemacs/elib-1.0")) 
(add-to-list 'load-path (expand-file-name "~/myemacs/cedet-1.0pre3/common"))

(load-file (expand-file-name "~/myemacs/cedet-1.0pre3/common/cedet.el"))

;; If you want Emacs to defer loading the JDE until you open a 
;; Java file, edit the following line
(setq defer-loading-jde nil)
;; to read:
;;
;;  (setq defer-loading-jde t)
;;

(if defer-loading-jde
    (progn
      (autoload 'jde-mode "jde" "JDE mode." t)
      (setq auto-mode-alist
	    (append
	     '(("\\.java\\'" . jde-mode))
	     auto-mode-alist)))
  (require 'jde))


(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.
 '(jde-jdk (quote ("1.5.0")))
 '(jde-jdk-registry (quote (("1.5.0" . "/usr/lib/jvm/java-1.5.0-sun")))))
(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.
 )
所有的lisp文件打包下载:
http://ftp.ubuntu.org.cn/emacs/myemacs.tar.gz

摸索了几天才弄出来的,呵呵,
附件
Screenshot.png
上次由 xiao2004 在 2007-03-16 13:13,总共编辑 1 次。
xiao2004
帖子: 56
注册时间: 2006-05-15 3:22
送出感谢: 0
接收感谢: 0

#2

帖子 xiao2004 » 2007-03-15 23:57

头像
ldxno_1cn
帖子: 160
注册时间: 2007-01-03 9:16
送出感谢: 0
接收感谢: 2 次

#3

帖子 ldxno_1cn » 2007-12-28 19:23

:( 郁闷了我完全按你的方法试过了可是不成功.EMACS会报错
halve
帖子: 45
注册时间: 2005-09-09 11:32
送出感谢: 0
接收感谢: 0

#4

帖子 halve » 2008-01-02 10:40

地址变了,现在打包文件在
http://ftp.ubuntu.org.cn/soft/emacs/
回复

回到 “Vim和Emacs”