SublimeAStyleFormatter is a code formatter/beautifier for Sublime Text. It provides ability to format C/C++/C#/Java files.
SublimeAStyleFormatter is a simple code formatter plugin for Sublime Text. It provides ability to format C, C++, Cuda-C++, OpenCL, C#, and Java files.
NOTE: Syntax files required to be installed separately for Cuda-C++ and OpenCL.
If you find my work useful, please consider buying me a cup of coffee, all donations are much appreciated :)
The easiest way to install SublimeAStyleFormatter is through Package Control.
Once you have Package Control installed, restart Sublime Text.
The advantage of using Package Control is that it will keep SublimeAStyleFormatter up to date.
Without Git:
Download the latest source code, and extract it to the Packages directory.
With Git:
Type the following command in your Sublime Text 2 or Sublime Text 3 Packages directory:
git clone git://github.com/timonwong/SublimeAStyleFormatter.git
The "Packages" directory is located at:
Sublime Text 2
%APPDATA%\Sublime Text 2\Packages
~/.config/sublime-text-2/Packages/
~/Library/Application Support/Sublime Text 2/Packages/
Sublime Text 3
%APPDATA%\Sublime Text 3\Packages
~/.config/sublime-text-3/Packages/
~/Library/Application Support/Sublime Text 3/Packages/
The default key bindings for this plugin:
Windows, Linux:
OSX:
Open the command palette, it apperas as SublimeAStyleFormatter: Format Current File
and
SublimeAStyleFormatter Format Current Selection
.
Before starting, you may want to have a look at SublimeAStyleFormatter.sublime-settings.
To edit your project setting, select Project/Edit Project
from main menu. A project setting contains
per-project settings for SublimeAStyleFormatter should look like this:
{
"settings":
{
"AStyleFormatter":
{
}
}
}
For example, if you don't want to inherit the default settings, instead, use your own astylerc file for C and C++ individually, then your project setting might look like this:
{
"settings":
{
"AStyleFormatter":
{
"options_c":
{
"use_only_additional_options": true,
"additional_options_file": "/path/to/your/astylerc/for/c"
},
"options_c++":
{
"use_only_additional_options": true,
"additional_options_file": "/path/to/your/astylerc/for/c++"
}
}
}
}
v2.0.1 (06/26/2013)
v2.0.0 (06/22/2013)
style
options instead if you have any those deprecated options (usually in your astylerc
files).pad-first-paren-out
, close-templates
, max-code-length
and break-after-logical
.v1.9.4 (04/16/2013)
v1.9.3 (03/24/2013)
v1.9.2 (03/16/2013)
v1.9.1 (03/10/2013)
v1.9 (03/08/2013)
v1.8 (12/24/2012)
autoformat_on_save
).v1.7.3 (12/18/2012)
v1.7.1 (11/22/2012)
v1.7 (11/10/2012)
v1.6.2 (11/5/2012)
v1.6.1 (10/20/2012)
v1.6 (10/19/2012)
v1.5 (10/16/2012)
v1.4.1 (10/6/2012)
v1.4 (9/28/2012)
v1.3 (9/21/2012)
v1.2 (4/19/2012)
v1.1 (2/5/2012)
This plugin is using MIT License:
Copyright (c) 2012 Timon Wong
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.
Artistic Style - A Free, Fast and Small Automatic Formatter for C, C++, C#, and Java Source Code.
Licensed under GNU Lesser General Public License version 3.0