---
title: "eclipse code format设置"
author: "water84222"
date: "2008-09-19T10:28:49Z"
tags: []
slug: "eclipse-code-format"
draft: false
lastmod: "2008-09-19T10:28:49Z"
id: 244020
url: "https://onlyLove.iteye.com/blog/244020"
---

eclipse code format设置

 

上面仅仅是针对Eclipse基本的Editor设置。对于Java/HTML/Ant等扩展编辑器，你还不得不单独去设定  
      * Preference:  
       1). For Java: sets java code style in eclipse  
           windows-&gt;preferences-&gt;java-&gt;Code style-&gt;Formatter  
           add a new profile , for more detail, test it in eclipse please  
       2). For Ant: sets build.xml in eclipse  
           windows-&gt;preferences-&gt;Ant&gt;Editor-&gt;Formatter  
           uncheck \[Use tab character instead of spaces] option.  
       3). For Html:  
           windows-&gt;preferences-&gt;Web and XML-&gt;HTML Files-&gt;HTML Source  
           select "Indent using tabs" and set space =2  
       4). For XML:  
           windows-&gt;preferences-&gt;Web and XML-&gt;XML Files-&gt;XML Source  
           select "Indent using tabs" and set space =2  
       5). For Properties  
    3). 如何配置jsp,properties等文件默认使用UTF-8编码创建或者阅读？  
     (Eclipse3.2+) Windows-&gt;General-&gt;Content Types下选择指定的扩展名，然后说明相应的编码，然后Update.  
    4). 转换存在文件的回车换行格式  
      毕竟不是专业编辑器，好像没有这个功能