나는 vim을 배우려고합니다 :-) 자동 들여 쓰기로 인해 파이썬 코드의 의미가 바뀌는 것과 관련된 실제 문제가 있습니다. 아래에있는 것과 같은 행동을하지 않고 자동 삽입의 장점을 얻을 수있는 방법이 있습니까?Vim 파이썬 들여 쓰기가 코드 의미를 변경합니다.
나는 파이썬 파일을 시작합니다 유지하기 위해 노력
[email protected]:/tmp$ cat pytest.py if False: print('Never', 'print this line') print 'Always print this line.'
: vim pytest.py
, gg=G
와
[email protected]:/tmp$ cat pytest.py if False: print('Never', 'print this line') print 'Always print this line.'
자동 들여 쓰기
:wq
는 D' 오, 내 스크립트를 엉망 이 바닐라 :
[email protected]:/tmp$ cat ~/.vimrc filetype plugin on filetype indent on autocmd FileType python set sw=4 autocmd FileType python set ts=4 autocmd FileType python set sts=4 autocmd FileType python set textwidth=79
들여 쓰기가 필수적이지 않은 언어로 작성하는 경우에도 자동 들여 쓰기를 사용하지 않는 이유입니다. 코드를 작성하는 동안 코드를 깨끗하게 유지하고 모든 종류의 자동화 된 조작을 피하는 것이 좋습니다. – redShadow