使用 Eclipse 开发,字符集和 tab 键是空格等问题经常困扰开发中,特别是在 windows 和 linux 切换时,进程会因为文件格式导致问题,如文件 bom 格式。本文中重点介绍 eclipse 调优和 pydev 设置。
Eclipse 更改默认字符集 设置 UTF-8 Unix
打开选项:Window -> Preferences -> General -> Workspace;
在右侧 Text file encoding 选择 Other,改变为 UTF-8

Eclipse 设置软 tab
用 4 个空格字符代替
打开选项:General -> Editors -> Text Editors
在右侧找到 Displayed tab width: 把下面的“Insert spaces for tabs”勾选上。

针对 java 文件配置 softtab
- 打开选项:General -> Editors -> Java -> Code Style -> Formatter,然后点击 Active profile 中的 Edit 按钮,如下图:


在弹出的窗口中,选择 General settings 中的 Tab policy 为 Spaces only,修改 Profile name 然后保存即可
Eclipse pydev 配置
在部署使用 eclipse 配置 Python 开发环境是,时长遇到 eclipse 版本与 pydev 不一致的问题,本文章主要介绍他们之间的对应关系。
Need to use older Eclipse/Java
If you need to use an older version of Eclipse/Java, below is the latest PyDev version to be used based on your requisites.
Eclipse 4.5, Java 8: PyDev 5.2.0
Eclipse 3.8, Java 7: PyDev 4.5.5
Eclipse 3.x, Java 6: PyDev 2.8.2