Fork me on GitHub

OK, that was easy. I'm editing LaTeX and every time I save I'm recompiling the file, so my fingers are getting used to the rhythm of SPC f s SPC c r. Then I thought, "Isn't there a way to add hooks in emacs? Could I automatically compile after saving the file?" Answer: yes. A couple of minutes later, after a couple quick web searches and a SPC h d k to describe what function gets called when I say SPC c r to recompile, et viola! > :(add-hook 'after-save-hook 'recompile)


Or, better yet, :(add-hook 'after-save-hook 'recompile nil t) to make a buffer-local hook.