Skip to content

lbragile/Line-Width-Indicator

Repository files navigation

Line Width Indicator πŸ”₯

Marketplace License

LWI Demo

Tired of guessing how many more characters you can type before your formatter decides its time to wrap to the next line? What about those hefty rulers that seem out of place? Wouldn't it be nice to have a visual indicator as you type?

This is exactly what Line Width Indicator does! It simply places a counter at the end of each line that indicates how many characters you have left before you reach a settings configurable value.

Line Width Indicator is also Open Source under MIT License. Visit the repository and feel free to contribute!

Features 😍

Currently the indicator is shown and updates as you type with predefined colors that can be adjusted in the settings. You can also adjust which languages are affected and the maximum threshold value that your formatter allows.

Future Plans πŸ“ˆ

  • Formatting trigger when limit is reached
  • Position of comments configured in settings (same line or above)
  • Incorporate user feedback!
  • Automatic comment insertion which prevents default formatter from acting on the line. Only added when a given threshold is passed. Also configurable in settings.
  • Position and/or style indicator configured in settings

Requirements πŸ‘

None πŸ˜‹

Extension Settings βš™

You can add the following settings:

  • LWI.excludedLanguages: An array of languages identifiers for which you wish not to use the 'Line Width Indicator' extension.
  • LWI.breakpoints: The counter will change to the respective color when its count is below that column's value.
  • LWI.ignoreComment: A comment that is added to preserve the current line formatting (no wrapping). Depending on your formatter, this will differ.
  • LWI.style.margin: The space between the text being typed and LWI counter.
  • LWI.style.fontWeight: The counter's thickness (from 100 to 900).
  • LWI.style.fontStyle: The counter's style (normal, italics, or oblique/slanted).
  • LWI.style.backgroundColor: The counter's color is added in LWI.breakpoints and this adds a contrasting background color.

Style Example

Style Demo

Available Commands πŸ’»

Commands

  • ctrl+shift+i: Enable/Disable LWI (on documents with supported languages)
  • ctrl+shift+/: Add/Remove Format Ignore Comment. E.g. "// prettier-ignore"

Known Issues πŸ™„

None... yet

Release Notes

Core functionality is now complete! More work will be added in the very near future - Stay tuned.

See the Change Log for more in depth details.


Enjoy!