guywaldman / vscode-prismo

Visual Studio Code plugin to beautify your titles, sections and separators.
https://marketplace.visualstudio.com/items?itemName=guywaldman.prismo
MIT License
6 stars 0 forks source link
beautify comment format javascript typescript vscode vscode-extension

Prismo for VSCode

Visual Studio Marketplace Travis branch

Visual Studio Code extension to beautify your titles, sections and separators.

Marketplace | GitHub

Preview


Motivation

Prismo is a small, lightweight extension with a very simple premise: it offers assistance in separating your source code into convenient, structured sections.

I like neat and clean source code. Generally, decorated titles in source code (as pretty as they may be) can be obtrusive and even sometimes obnoxious to work with for other developers skimming through your code in the future.

However, in some cases, well-placed titles can add structure to your source code (especially on projects where large files cannot be avoided). This is where Prismo shines.

You may be familiar with my previous plugins that achieved similar goals - AutoSect for Atom and Prismo for vim.

Note: full-width spanning titles can be obtrusive and are recommended to be used with caution. In some instances, in my opinion, they can be helpful. An option to configure the width on all title variations is available as width (0 for full width).

Features

Features to be Added

Top-Level Configuration

prismo.commentPatterns

This is a top-level configuration object containing a mapping of a language identifier to its respective commenting pattern, with the title represented by %s. For example, a row containing hello world and the commenting pattern #%s# could be commented like so: # --- hello world --- #. For a language not existing in the extension's presets, the user will have to input the appropriate commenting pattern and it will be saved in this object.

Example configuration:

{
  "python": "#%s",
  "javascript": "//%s"
}

Level-specific Configuration

There are three variations/levels:

You can customize the configurations per level, meaning prismo.normal contains the configurations for the top-level titles and prismo.light and prismo.hair contain the same types of options.

prismo.normal, prismo.light and prismo.hair are all objects containing the following properties:

However, they have different defaults.

Default Configurations Per Level

Regions

Preview

Use Prismo -> Regionize to add regions to your source code. Similarly to comments, it draws its patterns from prismo.regionPatterns configuration.

Is planned to be more configurable in the future.