Sublime Text plugin to format files faster using prettierd.
- Install prettierd globally with npm/yarn/pnpm:
npm i -g @fsouza/prettierd
- Install this plugin with Package Control:
Package Control: Install Package
→ Prettierd Format
- Restart Sublime Text
By default it formats on save any file supported by Prettier out-of-the-box.
To format a file:
Prettierd: Format
To save a file without formatting:
Prettierd: Save without formatting
Enable/disable format on save:
"format_on_save": true
Add additional extensions (enabled via prettier plugins) to be formatted either on save or commands:
"additional_extensions": ["php"]
Exclude extensions from being formatted on save:
"disabled_extensions_on_save": ["md"]
Exclude directories from being formatted on save:
"disabled_directories_on_save": ["*/node_modules/*"]
Optional, path to prettierd
executable. If not specified, it will be searched for in the system:
"prettierd_path": null
This plugin does nothing else than piping the input to prettierd
and replacing the view contents with the output.
It is basically just like executing cat file.js | prettierd file.js
with the command line.
For this reason, any issue with prettier plugins or configuration should be investigated on the prettierd repo as it is the underlying tool actually interacting with Prettier.
As of September 2023, there are some upstream issues with Astro and Svelte files.
You can format them with the command LSP: format
after installing their LSPs and enabling format on save for each language in the LSP settings.
Using the above command not only respects the .prettierrc
configuration but is also very fast.
0BSD