- Total 464K
- Win 278K
- OS X 126K
- Linux 60K
|Feb 26||Feb 25||Feb 24||Feb 23||Feb 22||Feb 21||Feb 20||Feb 19||Feb 18||Feb 17||Feb 16||Feb 15||Feb 14||Feb 13||Feb 12||Feb 11||Feb 10||Feb 9||Feb 8||Feb 7||Feb 6||Feb 5||Feb 4||Feb 3||Feb 2||Feb 1||Jan 31||Jan 30||Jan 29||Jan 28||Jan 27||Jan 26||Jan 25||Jan 24||Jan 23||Jan 22||Jan 21||Jan 20||Jan 19||Jan 18||Jan 17||Jan 16||Jan 15||Jan 14||Jan 13||Jan 12|
LOOKING FOR A NEW MAINTAINER
I haven't been giving JsFormat the attention it deserves lately, and I'd like to bring on someone else to help maintain the project. Shoot me an email if you are interested.
- all settings are customizable (whitespace, formatting style, etc..)
- .jsbeautifyrc settings files support for even more control on a per-project basis
- puts the cursor back in the same location it was before formatting (accounts for whitespace/newline changes)
- Sublime Text 3 support
JsFormat uses whatever tab/indent settings are configured with the standard
tab_size sublime settings.
The following JsBeautifier settings are available in JsFormat/JsFormat.sublime-settings (defaults shown below). Check out the official jsbeautifier documentation for more details on the options:
The following JsFormat specific settings are also exposed:
format_on_save: false (format files on buffer save)
format_on_save_extensions: [“js”, “json”]
jsbeautifyrc_files: false (see the .jsbeautifyrc files section)
I had temporary lapse of judgment a while back and merged a pull request that modified jsbeautifier. As a result, the functionality that
was added from that pull request has been lost;
"ensure_space_before_linestarters" is no longer supported.
The JsFormat specific
ensure_newline_at_eof_on_save setting has also been removed. This functionality exists in sublime core.
JsFormat now supports
.jsbeautifyrc JSON files (disabled by default), which themselves support any of the exposed JsBeautifier options. The option augmentation order is: default options -> user settings ->
.jsbeautifyrc option files.
A hierarchy of
.jsbeautifyrc files is supported, where rc files at the deeper levels override the settings from rc files at higher levels. For example, given the file structure listed below, formatting
/home/you/myProject/app.js would inherit settings from: default -> user settings ->
/home/you/myProject/.jsbeautifyrc, while formatting
/home/you/myProject/tests/test.js would inherit settings from: default -> user settings ->
Package Control (Recommended)
JsFormat is now included in the default repository channel for Package Control. It should show up in your install list with no changes.
If it does not show up, or you are on an older version of Package Control, add https://github.com/jdc0589/JsFormat as a Package Control repository. JsFormat will show up in the package install list.
Clone this repository in to the Sublime Text 2 “Packages” directory, which is located where ever the “Preferences” -> “Browse Packages” option in sublime takes you.
The default key binding is “ctrl+alt+f”
Key Binding Conflicts
Unfortunately there are other plugins that use “ctrl + alt + f”, this is a hard problem to solve. If JsFormat works OK via the command palette but does nothing when you use the “ctrl + alt + f” shortcut, you have two options:
- Find the offending plugin, and change the shortcut in its sublime-keymap file (will revert on updates)
Copyright © 2012 Davis Clark
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.