• Packages
  • Themes
  • Documentation
  • Blog
  • Discussions
Sign in

auto-detect-indentation

Automatically detect indentation of opened files.
jtokoph
184,552
412
  • Repo
  • Bugs
  • Versions
  • License
Flag as spam or malicious

Auto Detect Indentation for atom

Automatically detect indentation of opened files. It looks at each opened file and sets file specific tab settings (hard/soft tabs, tab length) based on the content of the file instead of always using the editor defaults.

You might have atom configured to use 4 spaces for tabs but open a rails project which defaults to 2 spaces. Without this package, you would have to change your tabstop settings globally or risk having inconsistent lead spacing in your files.

Keymap

To add a keyboard shortcut for the indentation selector menu, use the auto-detect-indentation:show-indentation-selector command. Here's an example:

keymap.cson

'atom-text-editor':
  'ctrl-I': 'auto-detect-indentation:show-indentation-selector'

Configuring indentation

You can add auto-detect-indentation.indentationTypes to your config.cson file to change the types of indentation available in the indent selector menu. Here's an example:

config.cson

"auto-detect-indentation":
  indentationTypes: [
    {
      name: "Best Indent"
      softTabs: true
      tabLength: 16
    }
  ]

Build Status

Special Thanks To Contributors

  • François Galea
  • Roger Chen

I think this package is bad news.

Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.

  • Terms of Use
  • Privacy
  • Code of Conduct
  • Releases
  • FAQ
  • Contact
with by