Sublime Text 3: Batch Tab to Spaces Conversion

Quick and dirty blurb: I needed to batch convert a bunch of source files from tab indentation to spaces. Sublime Text 3 does this well, but doing one at a time sucks…

This can be handled easily with a console command:

  1. Open up the file(s) you want to convert

  2. Issue the following console command:

    [v.run_command(‘expand_tabs’, {“set_translate_tabs”: True}) for v in window.views()]

You can then view each files results before saving, or be brave and File -> Save All.