2013년 6월 11일 화요일

eclipse - tabs & whitespace

0. why?
 - eclipse editor에서는 보이지 않지만 whitespace와 tabs이 섞여 있으면 notepad 같은 editor에서 indent가 뒤죽박죽이다. 그래서 whitespace를 사용해준다. spacebar를 계속 눌러주는 건 아니고 아래 설정으로 편하게 사용한다.

1. For the default text editor:
  • General > Editors > Text Editors > Insert spaces for tabs (check it)
  • General > Editors > Text Editors > Show whitespace characters (check it) - 화면에 whitespace를 점으로 보여준다. (보기 불편하면 skip)
2. For Java:
  • Java > Preferences > Code Style > Formatter > Edit > Indentation (choose "spaces only")
  • Rename the formatter settings profile to save it
3. tip

 - eclipse에서 Ctrl + Shift + f 를 눌러주면 자동 정렬 된다.

댓글 없음:

댓글 쓰기