• vi에서 indentation을 맞추는게 생각보다 까다롭다. 어떤 툴을 써서 각자의 코드에 맞게 수정을 한다던지...
  • how-do-i-fix-the-indentation-of-an-entire-file-in-vi 에서 indentation 파일 전체를 하는방법이 있다.
  • 참고로 gg는 파일 첫번째 줄로 이동, G는 파일 맨끝으로 이동, ==은 indentation 아래는 이명령어의 조합을 사용
파일 전체 들여쓰기
gg=G    

To indent the all the lines below the current line  
\=G

# To indent the current line

To indent n lines below the current line  
n==

For example, to indent 4 lines below the current line  
4==

To indent a block of code, go to one of the braces and use command  
\=% 
  • 이렇게 하면 들여쓰기가 자동으로 맞춰지는 무슨 기준으로 맞춰지는걸까...
  • indent-multiple-lines-quickly-in-vi 에 상당히 자세하게 나와있다 이후에 한번 살펴보자

+ Recent posts