Skip to content

πŸ‡¬πŸ‡§ Clean, consistent and ready-to-use formatting setup for Visual Studio Code β€” no Prettier, no extensions, no scripts per project πŸ‡«πŸ‡· Configuration de formatage propre, cohΓ©rente et prΓͺte Γ  l’emploi pour VS Code, sans Prettier, sans extensions ni scripts par projet.

License

Notifications You must be signed in to change notification settings

Palks-Studio/vs-code-formatting-pack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

242 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

VS Code formatting pack β€” before and after formatting example

πŸ‡¬πŸ‡§ English | πŸ‡«πŸ‡· FranΓ§ais

Made for VS Code Python Platform License VS Code Local No Extensions

VS Code – Formatting Pack

This repository is a technical presentation and documentation repository.
It does not contain downloadable source code or production files.

A configured working environment for Visual Studio Code.

This pack provides a clear and consistent framework for formatting, cleanup, and normalization
of common file types (.py, .html, .css, .js, .json, .txt),
using VS Code settings and locally executed Python scripts.

The goal is not blind automation,
but a controlled set of tools
that lets you keep full control over code structure, readability, and consistency,
regardless of the operating system.


Pack Structure

vscode_formatting_pack_V1.1/
β”‚
β”œβ”€β”€ .vscode/
β”‚   β”œβ”€β”€ extensions.json                 β†’ Local disabling of conflicting extensions (Prettier, RunOnSave)
β”‚   β”œβ”€β”€ launch.json                     β†’ Quick execution of the active Python script
β”‚   β”œβ”€β”€ settings.json                   β†’ Complete VS Code settings (indentation, LF, UTF-8, editor comfort)
β”‚   β”œβ”€β”€ keybindings.json                β†’ Shortcuts: Alt + M (minimap), Alt + R (re-indentation)
β”‚   └── tasks.json                      β†’ VS Code tasks (manually executable):
β”‚                                           - Python Formatting + Margin Cleanup
β”‚                                             (autopep8 + clean.py, active file)
β”‚                                           - Margin Cleanup (clean.py β€” global / active file / custom selection)
β”‚                                           - Margin Detection (space.py β€” read-only analysis)
β”‚                                           - CRLF β†’ LF Conversion (convert.py β€” global / active file / custom selection)
β”‚
β”œβ”€β”€ clean.py                            β†’ General margin and whitespace cleanup
β”œβ”€β”€ convert.py                          β†’ Line ending normalization (CRLF β†’ LF)
β”œβ”€β”€ space.py                            β†’ Margin analysis (read-only)
β”œβ”€β”€ backup.py                           β†’ Timestamped backup of the file on save (Ctrl + S)
β”‚                                         via the Auto-Backup task
β”‚ 
β”œβ”€β”€ LICENSE.md                          β†’ Terms of use and legal framework
β”‚ 
└── docs/
    β”œβ”€β”€ TECHNICAL_README.md             β†’ Technical documentation and internal structure
    β”œβ”€β”€ README_COMMERCIAL.md            β†’ Project overview and public presentation
    β”œβ”€β”€ INSTALL.md                      β†’ Installation and usage guide
    β”‚
    └── examples/                       β†’ (Optional) Detailed before/after formatting examples
        β”œβ”€β”€ before.py                   β†’ Dirty / unstructured example files
        β”œβ”€β”€ after.py                    β†’ Clean, formatted versions generated by the pack
        β”œβ”€β”€ convert_lf.mp4              β†’ CRLF files automatically converted to LF
        β”œβ”€β”€ indent_clean.mp4            β†’ Broken indentation/margins fixed instantly
        β”œβ”€β”€ indent_python.mp4           β†’ Badly indented Python file auto-corrected
        β”œβ”€β”€ backup.mp4                  β†’ Demonstrates automatic file backup on each save (Ctrl + S)
        β”‚                                 and how to restore a deleted file from the backup folder
        └── space_clean.mp4             β†’ Broken file analyzed and margins detected (read-only)

Key features

  • Complete and consistent configuration for Python, HTML, CSS, JS, JSON, and Markdown
  • Line width set around 100 characters for comfortable reading
  • Visual alignment consistent with the minimap (no excessive line breaks)
  • Controlled formatting and indentation, without altering code logic
  • Margin cleanup through dedicated scripts (spaces, tabs, excessive blank lines)
  • Local backup system allowing restoration of previously saved versions in case of error
  • Integrated practical shortcuts:
    • Alt + R β†’ Manual re-indentation of the active file
    • Alt + M β†’ Show / hide the minimap
  • Clean and readable output, without unnecessary visual clutter
  • Consistent behavior across Windows, macOS, and Linux
  • Carefully tuned common extensions (ErrorLens, Indent-Rainbow, Auto Rename Tag)

What’s new in version 1.1

Three execution modes for scripts

The clean.py, convert.py, and space.py scripts can be executed using three distinct modes, via VS Code tasks:

  • GLOBAL β†’ processes all supported files in the project
  • ACTIVE FILE β†’ applies only to the currently opened file
  • CUSTOM SELECTION β†’ allows files to be manually defined in tasks.json

These modes provide precise control and reduce the risk of unintended modifications.

Internal backup system (backup.py)

Version 1.1 introduces a local backup system integrated into the workflow:

  • Backup triggered each time a file is saved (Ctrl + S)
    • via the Auto-Backup VS Code task
  • No external extension required
  • Timestamped backups stored in .backups/<file_name>/
  • Ability to restore a previously saved version in case of error

This system acts as a standalone alternative to Local History
and works entirely offline, across all operating systems.

Expanded documentation (INSTALL.md, TECHNICAL_README.md)

Version 1.1 includes clearer and more structured documentation:

  • explanation of the three execution modes
  • complete overview of the backup system
  • internal details about script behavior
  • updated compatibility with VS Code 1.90+

Included settings details

settings.json

The provided settings are designed to offer a consistent and predictable working environment,
without triggering any unwanted automatic formatting.

Global formatting

  • formatOnSave disabled to avoid conflicts with external formatters (Black, Prettier, etc.)
  • Indentation set to 4 spaces
  • Line width configured around 100 characters
  • Encoding set to UTF-8
  • Default line endings set to LF
  • Settings aimed at minimizing rendering differences across operating systems

Readability and visual comfort

  • Line wrapping enabled (wordWrap: on) for continuous reading
  • Visualization of significant whitespace (renderWhitespace: boundary)
  • Smooth cursor animation and scrolling (cursorSmoothCaretAnimation, smoothScrolling)
  • Subtle visual guides to avoid unnecessary visual noise

Interface

  • Temporary preview file opening disabled
  • Neutral zoom level
  • Integrated terminal configured for comfortable reading (fontSize: 14)
  • Keyboard shortcuts limited to simple and explicit action

Protection and history

  • Settings compatible with the use of a local backup directory (.backups)
  • Local history enabled in Visual Studio Code
  • Automatic exclusion of common technical directories (node_modules, .git, __pycache__)

Errors and visibility

  • Configuration of the ErrorLens extension for direct in-editor error display
  • Intentionally restrained visual style to preserve code readability

Supported languages

The settings are adapted for the following file types:

Python

  • formatting via autopep8 (4-space indentation), triggered only through the dedicated task

HTML / CSS / JS

  • indentation handled by the editor
  • no automatic execution of external formatters

JSON / JSONC

  • fixed indentation
  • no automatic formatting to avoid breaking commented JSON files

Markdown

  • no automatic formatting
  • content and line breaks preserved

Automatic formatting on save is intentionally disabled
to maintain full control over applied changes.


Prettier (included configuration)

The provided Prettier settings define a consistent formatting framework,
without triggering any automatic formatting on save.

  • Line width configured around 100 characters
  • Indentation set to 4 spaces
  • Single quotes (') enforced for consistency
  • Trailing commas enabled (trailingComma: es5)
  • HTML whitespace handling configured (htmlWhitespaceSensitivity: ignore)
  • Line endings set to LF

These settings are compatible with Prettier,
but do not imply any automatic execution of the formatter.


Ergonomics and navigation

The interface settings aim to provide smooth and readable navigation,
without altering the editor’s standard behavior.

  • Cursor animation enabled (cursorSmoothCaretAnimation)
  • Smooth scrolling (smoothScrolling)
  • Active line highlighting (renderLineHighlight)
  • Minimap toggle via Alt + M
  • Temporary preview file opening disabled

Backup and history

  • Auto-save disabled to retain full manual control
  • Hot Exit enabled to restore open files after restart
  • Local history configured in Visual Studio Code
  • .backups/ directory used for backups via the dedicated task
  • UTF-8 encoding and LF line endings set by default

Productivity and cleanliness

  • No automatic formatting triggered on save (formatOnSave: false)
  • Cleanup operations (unnecessary spaces, blank lines, margins)
    are launched manually via VS Code tasks:
    • Terminal β†’ Run Task…
  • On save, VS Code applies only its native rules:
    • removal of trailing whitespace
    • insertion of a final newline
  • No runOnSave or automatic autopep8 execution is enabled by default
  • Common technical directories are excluded from operations
    (node_modules, .git, __pycache__)

Included extensions

The pack includes tuned configuration for common extensions:

  • ErrorLens β€” direct in-editor error display
  • Indent-Rainbow β€” visualization of indentation levels
  • Auto Rename Tag β€” automatic synchronization of HTML tags

These extensions remain optional and can be disabled freely.


General optimizations

The settings are designed to maintain a stable and readable environment:

  • Reduced number of active extensions to limit conflicts
  • Intentionally restrained interface, without visual clutter
  • Clear workspace organization (editor, explorer, terminal)
  • Automatic file preview disabled
  • Compatible with VS Code Settings Sync
  • Suitable for both individual and collaborative use

Performance and memory usage depend
on the user’s environment and system configuration.


keybindings.json

  • Alt + M β†’ toggles the minimap display (side view of the code)
  • Alt + R β†’ re-indents the currently active file

Tip: use Ctrl + A before Alt + R to re-indent the entire file.


tasks.json

Available VS Code tasks (manually executed):

  • Python Formatting + Margin Cleanup
    (autopep8 + clean.py, active file)
  • Margin Cleanup (clean.py)
  • Margin Detection (space.py β€” analysis only)
  • CRLF β†’ LF Conversion (convert.py)

launch.json

  • Allows manual execution of the active Python script in the editor
  • Useful for testing Python files individually

About Python formatting

  • The pack never alters Python code logic
  • It only affects formatting (indentation, spacing, readability)
  • If a file contains structural errors or inconsistent blocks,
    no automated tool can infer the correct intent
  • Manual correction may be required before running tasks
    that use autopep8 or clean.py

Python maintenance scripts

Scripts can be executed:

  • either via the provided VS Code tasks
  • or manually from a terminal

clean.py

  • Cleans margins on supported files
    (.html, .css, .js, .json, .py, .txt)
  • Removes unnecessary spaces and redundant tabs
  • Limits consecutive blank lines to a maximum of 2
python clean.py

convert.py

  • Normalizes CRLF (Windows) line endings to LF (Unix)
  • Writes to a file only when a conversion is actually required
python convert.py

space.py

Analyzes files and detects:

  • multiple spaces
  • tab characters
  • trailing whitespace
  • excessive blank lines (> 2)

No file is modified.

python space.py

Important β€” Script behavior

Depending on the executed task, the scripts (clean.py, convert.py, space.py) may operate:

  • on all supported files in the project
  • on the currently active file
  • or on a manually defined selection

A backup is created when a file is saved (Ctrl + S),
via the VS Code Auto-Backup task.

Backups are stored in the .backups/ directory
as timestamped copies.

Additional details are available in the INSTALL.md file.


Security and integrity

All scripts run locally:
no network connection, no data transfer.

Cleanup and conversion scripts always ignore
the .backups/ directory.

The code is readable and editable, with no obfuscation
and no dependency on external services.

Compatible with isolated environments
(offline, intranet, secured workstations).


Pack contents

  • settings.json β€” editor configuration
  • keybindings.json β€” keyboard shortcuts
  • tasks.json β€” VS Code tasks for cleanup and analysis
  • launch.json β€” manual execution of Python scripts
  • clean.py, convert.py, space.py, backup.py β€” maintenance scripts
  • docs/ β€” technical documentation and examples
  • LICENSE.md β€” Terms of use and legal Framework

Who is this pack for?

  • Developers who want a configured and consistent VS Code environment
    without spending time on complex setup.
  • Creators working on Python, HTML, CSS, or JSON projects
    who are looking for a stable and readable workspace.
  • Anyone who wants to maintain clean, aligned, and consistent code
    while keeping full control over the applied changes.

Compatibility and integration

  • Compatible with recent versions of Visual Studio Code
  • Works on Windows, macOS, and Linux
  • Requires no paid extensions or external services
  • Compatible with VS Code Settings Sync
  • Suitable for both individual and collaborative use
    (shared workspaces)

Quick FAQ

Does this pack modify my VS Code globally?
No. The provided settings are applied locally to the project folder.
They do not affect your global Visual Studio Code settings.

Are paid extensions required?
No. The pack relies only on VS Code settings and locally executed Python scripts.

Can I use this pack on multiple computers?
Yes. The pack files can be used on multiple machines.
Synchronization depends on using Settings Sync or sharing the project folder.


Palks Studio β€” Version 1.1
Compatible with Visual Studio Code (Prettier disabled locally).

Β© Palks Studio β€” see LICENSE.md

About

πŸ‡¬πŸ‡§ Clean, consistent and ready-to-use formatting setup for Visual Studio Code β€” no Prettier, no extensions, no scripts per project πŸ‡«πŸ‡· Configuration de formatage propre, cohΓ©rente et prΓͺte Γ  l’emploi pour VS Code, sans Prettier, sans extensions ni scripts par projet.

Topics

Resources

License

Stars

Watchers

Forks