Releases: sakhadib/auto-indent
Release list
White Space And Better Readability Format
Auto Indent - Smart Code Formatting for VS Code
A lightweight VS Code extension that automatically fixes code indentation for any programming language while respecting your editor preferences.
Features β¨
- Smart Indentation: Automatically adjusts the indentation of your code based on your editor settings.
- Multi-Language Support: Works with any programming language that VS Code supports.
- Batch Formatting: Format multiple selections at once.
- Customizable: Uses your editor settings for tab size, spaces, and indentation detection.
- Lightweight: No external dependencies or complex configurations.
- Cross-Platform: Works on Windows, macOS, and Linux.
- Open Source: MIT License
- Privacy-Focused: No data collection or telemetry.
Functionality π
- Indent your code based on your editor settings:
- Tab size
- Insert spaces
- Detect indentation
- Detects missplaced brackets, braces, and parentheses and fixes them.
- Add white lines between code blocks for better readability after
- blocks of code like
if,else,for,while,switch, etc. - function definitions
- class definitions
- blocks of code like
Installation π¦
- Download the vcix file from the releases page
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Click on the 3 dots in the top right corner
- Click on Install from VSIX
- Select the vcix file you downloaded
- Reload VS Code
Usage π οΈ
Basic Commands
- Command Palette (
Ctrl+Shift+P/Cmd+Shift+P):- Type "Fix Indentation" and press Enter
- Keyboard Shortcut:
Ctrl+Alt+I(Windows/Linux)Cmd+Opt+I(Mac)
- Context Menu:
- Right-click in editor β "Fix Indentation"
Supported Scenarios
- Format entire document (when no text selected)
- Format specific selection (highlight text first)
- Batch format multiple selections
Configuration βοΈ
The extension automatically uses your VS Code settings:
{
"editor.tabSize": 4,
"editor.insertSpaces": true,
"editor.detectIndentation": true
}Demo π₯
A messy C code snippet before formatting:
#include<stdio.h>
int add(int a, int b){
return a + b;
}
int Main(){
int MyVariable = 5;
float FloatingPointVariable = 3.14;
for(int i=0; i<10; i++){
printf("i = %d\n", i);
if(i==5){
printf("i is 5\n");
}
}
if(5>10){
printf("5 is grater");
}
while(1){
printf("Infinite loop\n");
}
}after pressing Ctrl+Alt+I:
#include<stdio.h>
int add(int a, int b)
{
return a + b;
}
int Main()
{
int MyVariable = 5;
float FloatingPointVariable = 3.14;
for(int i=0; i<10; i++)
{
printf("i = %d\n", i);
if(i==5)
{
printf("i is 5\n");
}
}
if(5>10)
{
printf("5 is grater");
}
while(1)
{
printf("Infinite loop\n");
}
}Contributing π€
Contributions are welcome! Feel free to open an issue or submit a pull request.
License π
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) [2025] [Adib Sakhawat]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
v0.0.2
Auto Indent v0.0.2
We're excited to announce the initial release of Auto Indent - your new best friend for clean, consistent code formatting!
What's New β¨
Core Features
- π Initial Release: First stable version of Auto Indent
- π§Ή Automatic indentation correction for entire files or selections
- π Language-agnostic support for all programming languages
- βοΈ Full compatibility with VS Code indentation settings
Technical Improvements
- π Optimized performance for large files
- π οΈ Robust error handling and user feedback
- π¦ Lightweight package with zero dependencies
Getting Started π
-
Download the latest
.vsixfrom the release assets -
Install in VS Code:
code --install-extension auto-indent-0.0.2.vsix
-
Use via:
- Command Palette: "Fix Indentation"
- Keyboard shortcut:
Ctrl+Alt+I/Cmd+Opt+I - Right-click context menu
Known Issues β οΈ
- May not handle minified code perfectly
- Performance may degrade with extremely large files (>10k lines)
- Some edge cases with mixed indentation styles
Changelog π
Added
- Initial extension implementation
- Core indentation logic
- User preference integration
- Notification system
Fixed
- Mixed indentation handling
- Selection edge cases
- Performance optimizations
What's Next? π§
- Multi-root workspace support
- Customizable indentation rules
- Format-on-save integration
- Language-specific enhancements
Version 0.0.1
Auto Indent v0.0.1
We're excited to announce the initial release of Auto Indent - your new best friend for clean, consistent code formatting!
What's New β¨
Core Features
- π Initial Release: First stable version of Auto Indent
- π§Ή Automatic indentation correction for entire files or selections
- π Language-agnostic support for all programming languages
- βοΈ Full compatibility with VS Code indentation settings
Technical Improvements
- π Optimized performance for large files
- π οΈ Robust error handling and user feedback
- π¦ Lightweight package with zero dependencies
Getting Started π
-
Download the latest
.vsixfrom the release assets -
Install in VS Code:
code --install-extension auto-indent-0.0.1.vsix
-
Use via:
- Command Palette: "Fix Indentation"
- Keyboard shortcut:
Ctrl+Alt+I/Cmd+Opt+I - Right-click context menu
Known Issues β οΈ
- May not handle minified code perfectly
- Performance may degrade with extremely large files (>10k lines)
- Some edge cases with mixed indentation styles
Changelog π
Added
- Initial extension implementation
- Core indentation logic
- User preference integration
- Notification system
Fixed
- Mixed indentation handling
- Selection edge cases
- Performance optimizations
What's Next? π§
- Multi-root workspace support
- Customizable indentation rules
- Format-on-save integration
- Language-specific enhancements