Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>KaizenNew to Visual Studio Code? Get it now.
Kaizen

Kaizen

Cyber Labs

|
379 installs
| (0) | Free
A collection of tools improving Visual Studio Code experience
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Kaizen

A collection of tools improving Visual Studio Code experience

Features

  • Highlight and delete trailing spaces
  • .env syntax highlighting
  • Sort imports

Trailing Spaces

highlight trailing spaces and delete them in a flash!

Synopsis

VS Code provides a way to automate deletion of trailing spaces by using the Trim Trailing Whitespace command. Depending on your settings, it may be more handy to just highlight them and/or delete them by hand, at any time. This plugin provides just that, and a lot of options to fine-tune the way you want to decimate trailing spaces.

Usage

Delete

The main feature you gain from using this plugin is that of deleting all trailing spaces in the currently edited document. In order to use this deletion feature, you may either:

  • press F1 and select/type "Trailing Spaces: Delete"
  • bind the deletion command to a keyboard shortcut:

To add a key binding, open "File / Preferences / Keyboard Shortcuts" and add:

{ "key": "alt+shift+t",        "command": "kaizen.deleteTrailingSpaces",
                                  "when": "editorTextFocus" },

With this setting, pressing Alt + Shift + t will delete all trailing spaces at once in the current file!

Delete - Modified Lines Only

You can also delete the trailing spaces exclusively from the modified (unsaved) lines. In order to use this deletion feature, you may either:

  • press F1 and select/type "Trailing Spaces: Delete - Modified Lines Only"
  • bind the deletion command to a keyboard shortcut:

To add a key binding, open "File / Preferences / Keyboard Shortcuts" and add:

{ "key": "alt+shift+m",        "command": "kaizen.deleteTrailingSpacesModifiedLinesOnly",
                                  "when": "editorTextFocus" },

Highlight

At any time, you can highlight the trailing spaces. You may either:

  • press F1 and select/type "Trailing Spaces: Highlight"
  • bind the highlighting command to a keyboard shortcut:
{ "key": "alt+shift+h",        "command": "kaizen.highlightTrailingSpaces",
                                  "when": "editorTextFocus" },

Options

Several options are available to customize the plugin's behavior. Those settings are stored in a configuration file, as JSON. You must use a specific file: Go to "File / Preferences / User Settings" to add your custom settings.

All settings are global (ie. applied to all opened documents).

Highlight Current Line

Default: true

Highlighting of trailing spaces in the currently edited line can be annoying: each time you are about to start a new word, the space you type is matched as a trailing spaces. Currently edited line can thus be ignored:

{ "kaizen.highlightCurrentLine": false }

Even though the trailing spaces are not highlighted on this line, they are still internally matched and will be deleted when firing the deletion command.

Include Empty Lines

Default: true

When firing the deletion command, empty lines are matched as trailing regions, and end up being deleted. You can specifically ignore them:

{ "kaizen.includeEmptyLines": false }

They will not be highlighted either.

Note: This option only deletes the trailing spaces in blank lines and not the whole line itself. If you want to delete the newline character as well, please consider changing the regex.

Delete Modified Lines Only

Default: false

When firing the deletion command, trailing regions in the entire document are deleted. There are some use-cases when deleting trailing spaces only on lines you edited is smarter; for instance when commiting changes to some third-party source code.

At any time, you can change which area is covered when deleting trailing regions by changing the setting:

{ "kaizen.deleteModifiedLinesOnly": true }

Trim On Save

Default: false

Setting this to true will ensure trailing spaces are deleted when you save your document. It abides by the other settings, such as Include Empty Lines.

{ "kaizen.trimOnSave": true }

Background Color

Default: rgba(255,0,0,0.3)

You can control the background color of the highlighting performed by Trailing Spaces using this option. To set up another color change the setting:

{ "kaizen.backgroundColor": "rgba(255,0,0,0.3)" }

Border Color

Default: rgba(255,100,100,0.15)

You can control the border color of the highlighting performed by Trailing Spaces using this option. To set up another color change the setting:

{ "kaizen.borderColor": "rgba(255,100,100,0.15)" }

The matching pattern

Default: [ \t]+

Trailing spaces are line-ending regions containing at least one simple space, tabs, or both. This pattern should be all you ever need, but if you do want to abide by another definition to cover edge-cases, go ahead:

// *danger* will match newline chars and many other folks
"kaizen.regexp": "[\\s]+"

.env file support

Files with name starting with .env will be handled as dotenv file.

If you use specific .env file naming convention (e.g. .env-jenkins) you can add dotenv support by setting the files.associations setting key as following:

"files.associations": {
    ".env-jenkins": "dotenv"
 }

Now, files with name .env-jenkins will be handled as dotenv file.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft