auto-detect-indentation

Automatically detect indentation of opened files.

Jason Tokoph

184,801

412

1.3.0

MIT

GitHub

This package consumes the following services:

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