1

I am editting typescript now, and I'd like to be able to have it so, whenever :w is invoked, the shell runs tsc compiling my new save.

This beats having to !tsc every time.

Does something like this exist? A build or toolchain command is also an acceptable answer, as long as it can be done in one short command.

5

Does something like this exist?

In Vim this is called an autocommand. The relevant help topic can be found by typing :h autocommand (sic!)

An example code to put into vimrc:

augroup typescript_save | au!
    autocmd BufWritePost *.ts execute '!tsc' expand("<afile>:p:S")
augroup end

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.