Search code examples
textwrangler

In TextWrangler, can I set the number of spaces per tab on a per-file-extension basis?


I want to use 4 spaces per tab in my Python code (.py files) and 2 spaces per tab in my JavaScript (.js files), and it is cumbersome to keep going to the preferences menu every time I switch between files.


Solution

  • If you enable "Emacs local variables" in the Preferences>>Text Files section, you can add per file settings:

    # -*- tab-width: 2 -*-
    

    Textwrangler has recently (August 2009) been updated to Version 3.0 which adds 'per-filetype' tab settings.