Autocmd

Autocommands are a way to tell Vim to run certain commands whenever certain events happen.