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

Auto​Set​Indentation

by jfcherng ST3

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

Details

Installs

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

Readme

Source
raw.​githubusercontent.​com

❌ [Deprecated] 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

As of Sublime Text 4, the dev team has been use test cases from this plugin to improve the built-in indentation detection and it works quite well. So, you probably no longer needs this plugin in Sublime Text 4.

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