Skip to content

Instantly share code, notes, and snippets.

@dpmccabe
Created October 1, 2014 04:09
Show Gist options
  • Save dpmccabe/1a40427418958cf23f5a to your computer and use it in GitHub Desktop.
Save dpmccabe/1a40427418958cf23f5a to your computer and use it in GitHub Desktop.
clean temporary files after latexing build
import sublime, sublime_plugin
from os.path import dirname, realpath
import subprocess
class BuildAndClean(sublime_plugin.TextCommand):
def run(self, edit):
self.view.window().run_command("build")
sublime.set_timeout_async(self.clean, 3000)
def clean(self):
subprocess.Popen("rm *.{log,aux,fdb_latexmk,synctex.gz,fls}", shell = True, cwd = dirname(realpath(self.view.file_name())))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment