Remove Leading Spaces Extension
A VS Code extension that removes lines containing only whitespace (spaces and tabs), replacing them with empty lines.
Features
- Remove lines that contain only whitespace (spaces and tabs), replacing them with empty lines
- Configurable keyboard shortcut:
CMD+Option+L (Mac) / Ctrl+Alt+L (Windows/Linux)
- Command palette support: "Remove Leading Spaces"
Usage
Via Keyboard Shortcut
- Press
CMD+Option+L (Mac) or Ctrl+Alt+L (Windows/Linux) while editing a file
Via Command Palette
- Open the Command Palette (
CMD+Shift+P on Mac, Ctrl+Shift+P on Windows/Linux)
- Type "Remove Leading Spaces"
- Press Enter
Installation
From Source
- Clone this repository
- Run
npm install to install dependencies
- Run
npm run compile to compile the TypeScript code
- Press
F5 to run the extension in a new Extension Development Host window
Packaging
To create a .vsix file for distribution:
- Install the
vsce tool: npm install -g vsce
- Run
vsce package to create the .vsix file
- Install the extension using
code --install-extension remove-leading-spaces-1.0.0.vsix
Development
- Run
npm run compile to compile TypeScript
- Run
npm run watch to compile in watch mode
- Press
F5 to run the extension in a new Extension Development Host window
License
See LICENSE file for details.
| |