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 5K
  • Win 3K
  • Mac 584
  • Linux 896
Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4 Sep 3 Sep 2 Sep 1 Aug 31 Aug 30 Aug 29 Aug 28 Aug 27 Aug 26 Aug 25 Aug 24 Aug 23 Aug 22 Aug 21 Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14
Windows 6 4 4 7 2 5 6 9 6 3 4 3 8 5 6 5 6 9 5 7 6 3 5 1 4 11 3 4 3 4 4 3 2 8 4 2 7 5 8 2 4 4 4 3 2 5
Mac 1 1 0 0 3 1 2 0 0 0 2 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 2 2 0 1 1 1 2 0 1 0 0 0 0 0 0 1 0 1 0
Linux 2 2 2 1 2 1 2 1 1 1 0 2 3 2 1 1 1 3 0 0 1 2 2 1 0 1 0 2 4 1 3 2 2 1 1 1 3 2 1 2 0 3 0 1 0 0

Readme

Source
raw.​githubusercontent.​com

ST-AutoSetIndentation

Travis (.org) branch Package Control GitHub tag (latest SemVer) Project license GitHub stars Donate to this project using Paypal

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