高效的Eclipse设置
虽然本人不是绝对的开发工具/IDE控,但是深感优秀的工具绝对能让开发事半功倍。
Eclipse是我们熟知的一款免费IDE,主要使用人群为java开发者。不过eclipse的默认配置并不一定是最优,跟IntelliJ IDEA这款商业IDE比较之下开发效率就会有不少差距。
但是别急,eclipse有强大的插件/配置能力,好好利用下,就算不能超过,至少也可以类比下IDEA,让我们患鼠标手的几率减少点~ 。
以下是我总结的eclipse配置/使用经验,欢迎大家补充。
设置项目
统一文件编码
Preferences - General - Workspace : Text file encoding 改为UTF-8
加大默认换行长度
java为例(xml等其他类似)
Preferences - Java - code style - formatter - new profile(based on builtin) - line wrapping - maximum line width: 120
编辑器中按任意字母代码自动完成
默认需要按快捷键出现
Preferences - Java - editor - Content Assist – Auto-Activation
– 修改auto activation triggers for java: .abc ,应用,关闭Prefference
– File - Export - General- Preference - save
– search ‘abc’ in the file,modify abc to abcdefghijklmnopqrstuvwxyz , save
– File - Import - General– Preference …
若以后在设置Preferences的时候点击了OK,可能造成配置失效,重新执行以上步骤
JS编辑器spket的设置类似
编辑器背景改为护眼绿色
Preferences - general - editors - Text Editors : 底部 background color - 自定义 RGB(204,232,207).
绑定高频率使用的菜单为热键
Preferences - general -keys
- content assistant : alt + j
- next editor: ctrl+tab
- override/imple…: method alt+i
Java文件保存时自动修正内容
Preferences - java - editor - save action,勾选:
Perform the selected actions on save
Organize imports
Additional actions 选择性添加
去除java范型过多验证
提高eclipse性能的几个关键点之一
Preferences - java - compiler - errors/warnings - generic types ,设置以下级别为忽略
- uunchecked generic type operation
- usage of a raw type
去掉实时验证
提高eclipse性能的几个关键点之一
Preferences - Validation, 第二列 (自动)Build项除了classpath dependency validation外全部去掉勾
减少非必要启动项
提高eclipse性能的几个关键点之一
General - startup and shutdown - 去除除了Emmet等必须项外的其他都去掉
插件推荐
spket
不错的js编辑器,直接代码提示,包括jQuery和ExtJs等
update url: http://www.agpad.com/update
start explorer
增强eclipse同操作系统的交互能力,如调用cmd, 复制文件绝对路径等。强力推荐
update url: http://basti1302.github.com/startexplorer/update/
emmet
zen coding for eclipse, 拒绝傻傻的手写全部html代码
update url: http://download.emmet.io/eclipse/updates/
注意此插件安装完后会设置默认的热键,可能会和现有的冲突,建议适当去除: general - keys - category 排列名为emmet的项
hibernate tools
jpa entity同数据库表互相生成很方便
使用eclipse内置marketplace搜索jboss tool,并选择hibernate。
OS X Eclipse Launcher
解决mac下不能启动多个eclipse的问题