vim에게 저장시 문서를 컴파일하도록 어떻게 지시 할 수 있습니까? 문서를 저장할 때마다 큰 문서 (LaTeX와

vim은 문서를 저장할 때마다 큰 문서 (LaTeX와 유사)를 자동으로 컴파일하고 싶습니다.

이러한 기능을 추가하여 저장할 수 있습니까? ( :w저장 하는 것 외에 다른 것을 사용하지 않는 것이 바람직합니다 .)



답변

자동 명령으로이를 수행 할 수 있습니다. 자동으로로드되는 파일이 없지만 하나의 파일로 잠시 동안 편집 컴파일 편집 사이클을 거칠 것임을 알고 있다면 Vim 명령 줄에서 다음과 같은 것을 실행합니다.

:au BufWritePost * make

make적절한 빌드 또는 실행 명령으로 바꿀 수 있습니다 .


답변

@garyjohn의 답변이 맞습니다.

coffeescript에서 다중 컴파일을 실행하는 방법에 대한 예를 추가하겠습니다.

# add these lines to your .vimrc file (~/.vimrc in my pc)
autocmd BufWritePost,FileWritePost *.coffee :silent !coffee --compile --join appstore/static/javascripts/angular/controllers.js file1.coffee file2.coffee

autocmd BufWritePost,FileWritePost *.coffee :silent !coffee --compile appstore/static/javascripts/angular/app.coffee appstore/static/javascripts/angular/directives.coffee appstore/static/javascripts/angular/filters.coffee appstore/static/javascripts/angular/services.coffee


답변