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 2K
  • Win 1K
  • OS X 226
  • Linux 342
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 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7 Aug 6 Aug 5 Aug 4
Windows 11 6 9 3 11 10 8 8 7 7 6 3 6 7 10 13 4 3 4 5 7 9 13 6 9 4 12 6 8 2 9 4 7 11 7 11 9 3 7 4 8 6 14 10 22 8
OS X 1 0 0 3 1 2 4 0 1 0 1 0 2 2 0 1 1 0 2 2 1 0 1 1 0 2 0 1 1 2 1 0 0 1 2 1 4 3 1 2 0 2 3 1 1 1
Linux 0 1 3 1 1 1 3 2 2 5 1 3 0 1 0 1 3 0 2 0 1 3 2 4 3 1 3 1 4 1 3 1 2 0 1 4 4 4 1 2 2 5 2 6 5 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.

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 detect the indentation internally before ASI is ready to work. After that, ASI will detect 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