Skip to content

Instantly share code, notes, and snippets.

@SangHakLee
Last active September 20, 2016 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SangHakLee/d5ca6a4205f7ee356da8cf2149182299 to your computer and use it in GitHub Desktop.
Save SangHakLee/d5ca6a4205f7ee356da8cf2149182299 to your computer and use it in GitHub Desktop.
Tab to Space

Tab to Space

retab

Q. 새로운 팀은 indent를 space로 한다. 내 코드는 tab인 상황에 어떻게 해야 할까?

A. retab

.vimrc 수정

$ vi ~/.vimrc

set softtabstop=4			"tab 키 눌렀을 때 이동 칸
set tabstop=4				"탭을 몇칸으로 할지 설정, 4로 하는게 좋음
set shiftwidth=4			"자동 탭 사이즈, << >> 눌렀을 때
set expandtab				"tab을 space로
"set noexpandtab			"tab을 tab으로
"이 줄은 주석입니다.

주석은 " <- 이것으로


테스트 파일 열기

$ vi test.html


retab

  1. Shift + ;(콜론)
  2. :retab
  3. Shift + ;(콜론)
  4. :wq

Atom tabs-to-spaces

https://atom.io/packages/tabs-to-spaces

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment