ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Auto​Set​Indentation

by jfcherng ST3

This plugin automatically detects and sets the indentation for you, by default, when a file is loaded.

Details

Installs

  • Total 3K
  • Win 2K
  • Mac 399
  • Linux 595
Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9 Feb 8 Feb 7 Feb 6 Feb 5 Feb 4 Feb 3 Feb 2 Feb 1 Jan 31 Jan 30 Jan 29 Jan 28 Jan 27 Jan 26 Jan 25 Jan 24 Jan 23 Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8 Jan 7
Windows 3 8 9 5 6 4 10 8 7 9 8 10 3 4 8 9 6 10 8 1 6 5 8 9 9 6 3 1 6 9 4 5 6 2 4 5 7 7 7 3 4 8 7 6 6 2
Mac 0 0 0 2 0 1 0 1 1 1 2 1 1 0 1 1 3 0 0 1 1 0 3 1 0 0 1 1 1 0 3 1 1 1 0 0 6 2 2 1 0 0 0 1 1 3
Linux 1 1 4 2 3 1 1 0 4 1 2 1 1 2 0 0 1 2 1 0 1 0 3 0 1 0 0 1 0 1 1 2 1 0 1 3 0 3 2 2 0 3 2 0 3 3

Readme

Source
raw.​githubusercontent.​com

Sublime-AutoSetIndentation

Travis (.org) branch Package Control GitHub tag (latest SemVer) Project license GitHub stars

This Sublime Text 3 plugin automatically detects and sets the indentation for you, by default, when a file is loaded.

Important Notice

Since ST 4050, the detect_indentation command has done quite a great job so you probably no longer needs this plugin.

Why Do I Make This?

Sublime Text detects the indentation when a file is loaded if detect_indentation is set to true, which is the default settings.

However, its detection is wrong sometimes. You could give following cases a try!

I find that Indent Finder detects above files correctly so I make it into this plugin.

Notes

  • Abbreviations

    • ST = Sublime Text
    • ASI = AutoSetIndentation (this plugin)
  • ASI respects indentation settings from .editorconfig files.

  • If you don't want to replace ST's detect_indentation command with ASI's, set the plugin setting hijack_st_detect_indentation to false.

  • Even if hijack_st_detect_indentation is set to true by default, ST will still detects the indentation internally before ASI is ready to work. After that, ASI will detects the indentation again hence ST's result will be overridden but the detection is done twice. Therefore, you may want to set detect_indentation to false to skip ST's.

Installation

This package is available on Package Control by the name of AutoSetIndentation.

Settings

To edit settings, go to Preferences » Package Settings » AutoSetIndentation » Settings.

I think the settings file is self-explanatory. But if you still have questions, feel free to open an issue.

Commands

You may disable all event_listeners in your user settings and add a key binding to auto set the indentation whenever you want.

{ "keys": ["ctrl+alt+s", "ctrl+alt+i"], "command": "auto_set_indentation" },

Acknowledgment