1.2.2 • Published 4 years ago

readable-indent v1.2.2

Weekly downloads
6
License
-
Repository
github
Last release
4 years ago

Commitizen friendly

Readable Indent VS Code Extension

Indents imports, KVPs (like object literals) with a pivot character sequence, padding whitespace for easy scanability.

Features

Simple indentation will make your code easier to visually scan. This extension will indent three common patterns on a pivot character sequence: = or : or => (fat-arrows).

Support for user-configured custom sequences will be added in a future release.

When applying readable-indent, use the pattern that makes the code snippet most readable:

Left-justified readable-indent

left-justified

Left-justified, alphabetized readable-indent

left-justified

Center-justified readable-indent

center-justified

Center-justified, alphabetized readable-indent

center-justified

Usage

  1. Select code snippet to make readable.
  2. Use context menu (right|ctrl click) or key mapping to apply readable-indent
Mac OSXWindows/Linux
Indentcmd-i cmd-actrl-i ctrl-a
Indent Alphabetizedcmd-i cmd-shift-actrl-i ctrl-shift-a
Indent Centeredcmd-i cmd-bctrl-i ctrl-b
Indent Centered Alphabetizedcmd-i cmd-shift-bctrl-i ctrl-shift-b

VS Code Configuration

Minimum Whitespace Before Pivot (Left-justfied Indent only)

Readable Indent adds a simple configuration to set a minimum whitespace gap from the start of the key to the pivot character. E.g.:

{
  "a": "foo",
  "bc": "bar"
}

With a setting of 10, the above will be indented as:

{
  "a"      : "foo",
  "bc"     : "bar"
}

Known Issues

Obviously this indentation is conflicted with OOTB rules for prettier. Pedagogy is out of scope for this extension ;).

Release Notes

See CHANGELOG for details