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

Auto​Set​Indentation

by jfcherng ST3 Trending

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

Details

  • 1.6.1
  • github.​com
  • github.​com
  • 3 months ago
  • 36 minutes ago
  • 9 months ago

Installs

  • Total 3K
  • Win 2K
  • OS X 320
  • Linux 500
Dec 5 Dec 4 Dec 3 Dec 2 Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21
Windows 8 15 21 8 6 6 9 11 11 8 9 4 5 3 9 8 6 6 1 6 5 15 10 7 9 1 5 5 2 10 5 6 5 3 5 5 11 8 10 3 6 6 13 13 6 4
OS X 2 2 2 1 0 0 4 1 0 1 1 2 1 1 2 3 1 0 1 1 0 0 0 1 3 0 1 2 1 1 0 0 0 0 1 1 1 2 3 2 1 1 3 3 2 2
Linux 3 1 1 2 1 1 2 3 0 1 5 1 1 2 1 2 1 4 2 0 4 1 2 0 0 0 1 3 3 2 0 1 1 1 2 4 4 4 7 2 3 0 2 3 3 4

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