Eclipse代码风格设置

1.【window】/【preferences】/【Java】/【code style】/【formatter】/【edit】

 

2.面板【indentation】

tab policy = spaces only indentation

size = 4

tab size = 4

他的作用是只适用空格缩进,不使用table,这样可以去除不同平台下的txt识别问题

选中align fields in columns 他的作用是对其类中定义的属性

 

3 面板【line wrapping】

maximum line width = 400

他的作用是不让代码自动换行

【method declarations】/【Parameters】

line wrapping policy = wrap all elements, exception first element if not necessary

选中 force split, even if line shorter than maxmum width indentation

policy = indent on column

作用是在方法声明的时候,一个参数一行,尤其是spring mvc里一个方法十几个参数的时候,看着非常爽

 

4 面板【comments】

去掉 Enable line comment formatting

他的含义是去掉单行注释的格式化

 

注:文章为拷贝别处,只为了自己设置eclipse的时候方便查找。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值