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

StackOverflow https://stackoverflow.com/questions/1269281

  •  13-09-2019
  •  | 
  •  

Question

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.

Was it helpful?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top